X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-data-store.c;h=65001dd170d98a3edaa903a619244b38e931b38f;hb=1485e3a189c42b1ac1339c063c85d9e74e503431;hp=13ad0cc6cd283edfb9656a67f4eb2b3f7ae7873b;hpb=f15c854d8500105766b2f5666bb62b983ff24f88;p=pspp-builds.git diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 13ad0cc6..65001dd1 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -583,12 +583,15 @@ psppire_data_store_get_string (PsppireDataStore *store, glong row, glong column) char *text; const struct fmt_spec *fp ; const struct variable *pv ; + const struct dictionary *dict; union value v; int width; g_return_val_if_fail (store->dict, NULL); g_return_val_if_fail (store->datasheet, NULL); + dict = store->dict->dict; + if (column >= psppire_dict_get_var_cnt (store->dict)) return NULL; @@ -614,17 +617,13 @@ psppire_data_store_get_string (PsppireDataStore *store, glong row, glong column) if (label) { value_destroy (&v, width); - return recode_string (UTF8, psppire_dict_encoding (store->dict), - label, -1); + return g_strdup (label); } } fp = var_get_write_format (pv); - /* Converts binary value V into printable form in the exactly - FP->W character in buffer S according to format specification - FP. No null terminator is appended to the buffer. */ - text = data_out (&v, fp); + text = data_out (&v, dict_get_encoding (dict), fp); g_strchomp (text); @@ -755,15 +754,9 @@ static const gchar null_var_name[]=N_("var"); static gchar * get_row_button_label (const PsppireSheetModel *model, gint unit) { - PsppireDataStore *ds = PSPPIRE_DATA_STORE (model); - gchar *s = g_strdup_printf (_("%d"), unit + FIRST_CASE_NUMBER); - - gchar *text = recode_string (UTF8, psppire_dict_encoding (ds->dict), - s, -1); - - g_free (s); + // PsppireDataStore *ds = PSPPIRE_DATA_STORE (model); - return text; + return g_strdup_printf (_("%d"), unit + FIRST_CASE_NUMBER); } @@ -808,6 +801,9 @@ get_column_button_label (const PsppireSheetModel *model, gint col) pv = psppire_dict_get_variable (ds->dict, col); + if (NULL == pv) + return NULL; + return xstrdup (var_get_name (pv)); }