X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-data-editor.c;h=ec7263af76698a457e6bf15e9379e2c205891baa;hb=edf539fc797fedcdf7a71894f707d3c9728335d6;hp=a2ca1d8851c2f5f0b0f7db905cad41ca1a1153e0;hpb=729b96a6bd9342c45e6f65a113fd87c70da85b0a;p=pspp-builds.git diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index a2ca1d88..ec7263af 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -1203,9 +1203,13 @@ popup_variable_row_menu (PsppireSheet *sheet, gint row, PsppireVarStore *var_store = PSPPIRE_VAR_STORE (psppire_sheet_get_model (sheet)); + + PsppireDict *dict; + const struct variable *v ; - const struct variable *v = - psppire_dict_get_variable (var_store->dict, row); + g_object_get (var_store, "dictionary", &dict, NULL); + + v = psppire_dict_get_variable (dict, row); if ( v && event->button == 3) { @@ -1357,6 +1361,7 @@ psppire_data_editor_delete_cases (PsppireDataEditor *de) void psppire_data_editor_delete_variables (PsppireDataEditor *de) { + PsppireDict *dict = NULL; gint first, n; switch (gtk_notebook_get_current_page (GTK_NOTEBOOK (de))) @@ -1374,7 +1379,9 @@ psppire_data_editor_delete_variables (PsppireDataEditor *de) break; } - psppire_dict_delete_variables (de->var_store->dict, first, n); + g_object_get (de->var_store, "dictionary", &dict, NULL); + + psppire_dict_delete_variables (dict, first, n); psppire_sheet_unselect_range (PSPPIRE_SHEET (de->data_sheet[0])); psppire_sheet_unselect_range (PSPPIRE_SHEET (de->var_sheet)); @@ -1613,6 +1620,7 @@ data_sheet_set_clip (PsppireSheet *sheet) /* Construct clip dictionary. */ clip_dict = dict_create (); + dict_set_encoding (clip_dict, dict_get_encoding (ds->dict->dict)); for (i = range.col0; i <= range.coli; i++) { const struct variable *old = dict_get_var (ds->dict->dict, i); @@ -1646,7 +1654,8 @@ enum { /* Perform data_out for case CC, variable V, appending to STRING */ static void -data_out_g_string (GString *string, const struct dictionary *dict, const struct variable *v, +data_out_g_string (GString *string, const struct dictionary *dict, + const struct variable *v, const struct ccase *cc) { const struct fmt_spec *fs = var_get_print_format (v); @@ -1654,7 +1663,7 @@ data_out_g_string (GString *string, const struct dictionary *dict, const struct char *s = data_out (val, dict_get_encoding (dict), fs); - g_string_append_len (string, s, fs->w); + g_string_append (string, s); g_free (s); } @@ -1711,9 +1720,11 @@ clip_to_html (void) const casenumber case_cnt = casereader_get_case_cnt (clip_datasheet); const size_t var_cnt = dict_get_var_cnt (clip_dict); - /* Guestimate the size needed */ - string = g_string_sized_new (20 * val_cnt * case_cnt); + string = g_string_sized_new (80 + 20 * val_cnt * case_cnt); + + g_string_append (string, + "\n"); g_string_append (string, "\n"); for (r = 0 ; r < case_cnt ; ++r )