Rename myconvfunc --> psppire_data_store_value_to_string
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 5 Apr 2017 10:27:29 +0000 (12:27 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 5 Apr 2017 10:27:29 +0000 (12:27 +0200)
src/ui/gui/psppire-data-editor.c
src/ui/gui/psppire-data-store.c
src/ui/gui/psppire-data-store.h

index 3808b7e822e609abb3f70b0f8dabbc506c57ce5c..f89614d8ed14cb5e0750bae1d9e7f5cce4de40de 100644 (file)
@@ -567,8 +567,8 @@ on_data_selection_change (PsppireDataEditor *de, JmdRange *sel)
 
 static void set_font_recursively (GtkWidget *w, gpointer data);
 
-gchar *myconvfunc (GtkTreeModel *m, gint col, gint row, const GValue *v);
-void myreversefunc (GtkTreeModel *model, gint col, gint row, const gchar *in, GValue *out);
+void myreversefunc (GtkTreeModel *model, gint col, gint row, const gchar *in,
+                   GValue *out);
 
 
 enum sort_order
@@ -932,8 +932,6 @@ psppire_data_editor_init (PsppireDataEditor *de)
   de->data_sheet_cases_row_popup = create_data_row_header_popup_menu (de);
   de->var_sheet_row_popup = create_var_row_header_popup_menu (de);
 
-  g_object_set (de->data_sheet, "export-function", myconvfunc, NULL);
-
   g_signal_connect (de->data_sheet, "row-header-pressed",
                    G_CALLBACK (show_cases_row_popup), de);
 
@@ -943,8 +941,13 @@ psppire_data_editor_init (PsppireDataEditor *de)
   g_signal_connect (de->data_sheet, "selection-changed",
                    G_CALLBACK (set_menu_items_sensitivity), de);
 
+  /* FIXME:  The following two statements do basically the same thing.
+     Do we need both? */
+  g_object_set (de->data_sheet, "export-function",
+               psppire_data_store_value_to_string, NULL);
+
   jmd_sheet_set_conversion_func (JMD_SHEET (de->data_sheet),
-                                myconvfunc, myreversefunc);
+                                psppire_data_store_value_to_string, myreversefunc);
 
   GtkWidget *data_button = jmd_sheet_get_button (JMD_SHEET (de->data_sheet));
   gtk_button_set_label (GTK_BUTTON (data_button), _("Case"));
index 8f2855bb6d6e437971d3afe7053049171e72aaea..a8e86072de74c453a9c20914bca999b74f3e5e38 100644 (file)
@@ -157,10 +157,8 @@ myreversefunc (GtkTreeModel *model, gint col, gint row,
 }
 
 gchar *
-myconvfunc (GtkTreeModel *model, gint col, gint row, const GValue *v)
+psppire_data_store_value_to_string (PsppireDataStore *store, gint col, gint row, const GValue *v)
 {
-  PsppireDataStore *store  = PSPPIRE_DATA_STORE (model);
-
   const struct variable *variable = psppire_dict_get_variable (store->dict, col);
   g_return_val_if_fail (variable, g_strdup ("???"));
 
index c9cfe4cfe00014b8c27440ae6a76fe693bee26f2..bbdb7eb9643bdc709ecda27b3a2711a08e7f7e8f 100644 (file)
@@ -109,6 +109,10 @@ gchar *psppire_data_store_get_string (PsppireDataStore *,
                                       glong row, const struct variable *,
                                       bool use_value_label);
 
+gchar * psppire_data_store_value_to_string (PsppireDataStore *store,
+                                           gint col, gint row,
+                                           const GValue *v);
+
 
 gboolean psppire_data_store_get_value (PsppireDataStore *store,
                                       glong row, const struct variable *var,