From c28781f010b27ed9c02442e07b74a9284994c746 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 5 Apr 2017 12:27:29 +0200 Subject: [PATCH] Rename myconvfunc --> psppire_data_store_value_to_string --- src/ui/gui/psppire-data-editor.c | 13 ++++++++----- src/ui/gui/psppire-data-store.c | 4 +--- src/ui/gui/psppire-data-store.h | 4 ++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 3808b7e822..f89614d8ed 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -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")); diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 8f2855bb6d..a8e86072de 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -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 ("???")); diff --git a/src/ui/gui/psppire-data-store.h b/src/ui/gui/psppire-data-store.h index c9cfe4cfe0..bbdb7eb964 100644 --- a/src/ui/gui/psppire-data-store.h +++ b/src/ui/gui/psppire-data-store.h @@ -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, -- 2.30.2