X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-data-editor.c;h=094a4f6988ada771e840e81b037be42e9b5203db;hb=refs%2Fbuilds%2F20101211030502%2Fpspp;hp=8a882e2c2d7bd3c63659748ec56d4dfcdb357f68;hpb=0a18c32ad55044070812325dd5e569259fac6a37;p=pspp diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 8a882e2c2d..094a4f6988 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -21,7 +21,6 @@ #include "psppire-data-editor.h" #include "psppire-var-sheet.h" -#include #include "psppire-data-store.h" #include #include @@ -1249,21 +1248,13 @@ popup_cases_menu (PsppireSheet *sheet, gint row, static void do_sort (PsppireDataStore *ds, int var, gboolean descend) { - GString *string = g_string_new ("SORT CASES BY "); - const struct variable *v = psppire_dict_get_variable (ds->dict, var); + gchar *syntax; - g_string_append_printf (string, "%s", var_get_name (v)); - - if ( descend ) - g_string_append (string, " (D)"); - - g_string_append (string, "."); - - execute_syntax (create_syntax_string_source (string->str)); - - g_string_free (string, TRUE); + syntax = g_strdup_printf ("SORT CASES BY %s%s.", + var_get_name (v), descend ? " (D)" : ""); + g_free (execute_syntax_string (syntax)); } @@ -1653,14 +1644,13 @@ 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 variable *v, const struct ccase *cc) { const struct fmt_spec *fs = var_get_print_format (v); const union value *val = case_data (cc, v); - char *s = data_out (val, dict_get_encoding (dict), fs); + char *s = data_out (val, var_get_encoding (v), fs); g_string_append (string, s); @@ -1694,7 +1684,7 @@ clip_to_text (void) for (c = 0 ; c < var_cnt ; ++c) { const struct variable *v = dict_get_var (clip_dict, c); - data_out_g_string (string, clip_dict, v, cc); + data_out_g_string (string, v, cc); if ( c < val_cnt - 1 ) g_string_append (string, "\t"); } @@ -1741,7 +1731,7 @@ clip_to_html (void) { const struct variable *v = dict_get_var (clip_dict, c); g_string_append (string, ""); - data_out_g_string (string, clip_dict, v, cc); + data_out_g_string (string, v, cc); g_string_append (string, "\n"); }