variable = psppire_dict_get_variable (store->dict, var_num);
posn = var_get_case_index (variable);
- printf ("insert var_num=%d, posn=%d\n", var_num, posn);
psppire_data_store_insert_value (store, var_get_width (variable), posn);
#if AXIS_TRANSITION
const struct variable *pv ;
union value v;
int width;
- GString *s;
g_return_val_if_fail (store->dict, NULL);
g_return_val_if_fail (store->datasheet, NULL);
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);
-
/* 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. */
- data_out (&v, fp, s->str);
-
- text = recode_string (UTF8, psppire_dict_encoding (store->dict),
- s->str, fp->w);
- g_string_free (s, TRUE);
+ text = data_out (&v, fp);
g_strchomp (text);
PsppireDataStore *store = PSPPIRE_DATA_STORE (model);
union value v;
- int width;
const struct variable *pv = psppire_dict_get_variable (store->dict, col);
+ int width = var_get_width (pv);
const gint index = var_get_case_index (pv) ;
- width = var_is_numeric (pv) ? 0 : MAX_SHORT_STRING;
value_init (&v, width);
value_set_missing (&v, width);
psppire_data_store_set_value (store, row, index, &v);
static gchar *
get_column_subtitle (const PsppireSheetModel *model, gint col)
{
- gchar *text;
const struct variable *v ;
PsppireDataStore *ds = PSPPIRE_DATA_STORE (model);
if ( ! var_has_label (v))
return NULL;
- text = recode_string (UTF8, psppire_dict_encoding (ds->dict),
- var_get_label (v), -1);
-
- return text;
+ return xstrdup (var_get_label (v));
}
static gchar *
get_column_button_label (const PsppireSheetModel *model, gint col)
{
- gchar *text;
struct variable *pv ;
PsppireDataStore *ds = PSPPIRE_DATA_STORE (model);
pv = psppire_dict_get_variable (ds->dict, col);
- text = recode_string (UTF8, psppire_dict_encoding (ds->dict),
- var_get_name (pv), -1);
-
- return text;
+ return xstrdup (var_get_name (pv));
}
static gboolean
else
value_set_missing (&value, width);
- printf("insert column width=%d\n", width);
datasheet_insert_column (ds->datasheet, &value, width, where);
return TRUE;