X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-data-store.c;h=c0fc42a2f285a87ff32a5da5a9e3d1595990a621;hb=51cf173b5eaaa8c5cc6233f9c8924eb44498e89d;hp=8ac492884c1c11b88709e809dfc56793443ff828;hpb=273fd32809f3e2ba6e98540966db0da221704c68;p=pspp diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 8ac492884c..c0fc42a2f2 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -155,9 +155,20 @@ psppire_data_store_string_to_value (GtkTreeModel *model, gint col, gint row, union value val; value_init (&val, width); - char *xx = - data_in (ss_cstr (in), psppire_dict_encoding (store->dict), - fmt->type, &val, width, "UTF-8"); + 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, &val, width, "UTF-8"); + } GVariant *vrnt = value_variant_new (&val, width); value_destroy (&val, width); @@ -176,7 +187,7 @@ unlabeled_value (PsppireDataStore *store, const struct variable *variable, const return g_strdup (""); const struct fmt_spec *fmt = var_get_print_format (variable); - return data_out (val, psppire_dict_encoding (store->dict), fmt); + return value_to_text__ (*val, fmt, psppire_dict_encoding (store->dict)); } gchar *