- gint idx;
- char *text;
- const struct fmt_spec *fp ;
- const struct variable *pv ;
- const union value *v ;
- GString *s;
- PsppireDataStore *store = PSPPIRE_DATA_STORE (model);
-
- g_return_val_if_fail (store->dict, NULL);
- g_return_val_if_fail (store->case_file, NULL);
-
- if (column >= psppire_dict_get_var_cnt (store->dict))
- return NULL;
-
- if ( row >= psppire_case_file_get_case_count (store->case_file))
- return NULL;
-
- pv = psppire_dict_get_variable (store->dict, column);
-
- idx = var_get_case_index (pv);
-
- v = psppire_case_file_get_value (store->case_file, row, idx);
-
- g_return_val_if_fail (v, NULL);
-
- if ( store->show_labels)
- {
- const struct val_labs * vl = var_get_value_labels (pv);
-
- const gchar *label;
- if ( (label = val_labs_find (vl, *v)) )
- {
- return pspp_locale_to_utf8 (label, -1, 0);
- }
- }
-
- fp = var_get_write_format (pv);
-
- s = g_string_sized_new (fp->w + 1);
- g_string_set_size (s, fp->w);
-
- memset (s->str, 0, fp->w);
-
- g_assert (fp->w == s->len);