X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Frecode-dialog.c;h=314367462e6f403d691f2c9896972086b610075f;hb=ddd7c113f3e50c8d87f6a677856799d05a1f40c7;hp=3468e580c8fe8068cb3306110bfcee92fd82ffab;hpb=1bcb0e4c5d3084983b86675187088bb3ad906cc2;p=pspp diff --git a/src/ui/gui/recode-dialog.c b/src/ui/gui/recode-dialog.c index 3468e580c8..314367462e 100644 --- a/src/ui/gui/recode-dialog.c +++ b/src/ui/gui/recode-dialog.c @@ -25,7 +25,6 @@ #include "recode-dialog.h" #include -#include #include #include @@ -35,7 +34,7 @@ #include #include #include -#include +#include #include "psppire-acr.h" @@ -374,7 +373,7 @@ enum { COL_OLD, COL_NEW_NAME, COL_NEW_LABEL, - n_COLS + n_COL_VARS }; enum { @@ -853,11 +852,10 @@ recode_dialog (struct data_editor *de, gboolean diff) GtkWidget *output_variable_box = get_widget_assert (xml,"frame4"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); rd.change_button = get_widget_assert (xml, "change-button"); @@ -903,7 +901,7 @@ recode_dialog (struct data_editor *de, gboolean diff) GtkTreeViewColumn *col; GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); - rd.var_map = gtk_list_store_new (n_COLS, G_TYPE_INT, + rd.var_map = gtk_list_store_new (n_COL_VARS, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING); @@ -1340,9 +1338,8 @@ new_value_append_syntax (GString *str, const struct new_value *nv) break; case NV_STRING: { - struct string ds; - ds_init_cstr (&ds, nv->v.s); - gen_quoted_string (&ds); + struct string ds = DS_EMPTY_INITIALIZER; + syntax_gen_string (&ds, ss_cstr (nv->v.s)); g_string_append (str, ds_cstr (&ds)); ds_destroy (&ds); } @@ -1373,9 +1370,8 @@ old_value_append_syntax (GString *str, const struct old_value *ov) break; case OV_STRING: { - struct string ds; - ds_init_cstr (&ds, ov->v.s); - gen_quoted_string (&ds); + struct string ds = DS_EMPTY_INITIALIZER; + syntax_gen_string (&ds, ss_cstr (ov->v.s)); g_string_append (str, ds_cstr (&ds)); ds_destroy (&ds); } @@ -1539,9 +1535,9 @@ generate_syntax (const struct recode_dialog *rd) continue; } - ds_init_cstr (&ls, label); + ds_init_empty (&ls); + syntax_gen_string (&ls, ss_cstr (label)); g_free (label); - gen_quoted_string (&ls); g_string_append_printf (str, "\nVARIABLE LABELS %s %s.", name, ds_cstr (&ls));