-static gint
-psppire_data_store_get_var_count (const GSheetModel *model)
-{
- const PsppireDataStore *store = PSPPIRE_DATA_STORE(model);
-
- return psppire_dict_get_var_cnt(store->dict);
+ union value val;
+ value_init (&val, width);
+ const struct val_labs *value_labels = var_get_value_labels (variable);
+ const union value *vp = NULL;
+ if (value_labels)
+ {
+ vp = val_labs_find_value (value_labels, in);
+ if (vp)
+ value_copy (&val, vp, width);
+ }
+ char *xx = NULL;
+ if (vp == NULL)
+ {
+ xx = data_in (ss_cstr (in), psppire_dict_encoding (store->dict),
+ fmt->type, settings_get_fmt_settings (),
+ &val, width, "UTF-8");
+ }
+
+ GVariant *vrnt = value_variant_new (&val, width);
+ value_destroy (&val, width);
+
+ g_value_init (out, G_TYPE_VARIANT);
+ g_value_set_variant (out, vrnt);
+ free (xx);
+ return TRUE;