From 4eb2e820b01d92ef662c741f5ac30f08bedd1de6 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 29 Sep 2017 11:46:52 +0200 Subject: [PATCH] Rename myreversefunc -> psppire_data_store_string_to_value --- src/ui/gui/psppire-data-sheet.c | 5 +---- src/ui/gui/psppire-data-store.c | 8 +++++--- src/ui/gui/psppire-data-store.h | 10 +++++++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/ui/gui/psppire-data-sheet.c b/src/ui/gui/psppire-data-sheet.c index 6aa3d19d68..4b7df0dc28 100644 --- a/src/ui/gui/psppire-data-sheet.c +++ b/src/ui/gui/psppire-data-sheet.c @@ -104,9 +104,6 @@ change_data_value (PsppireDataSheet *sheet, gint col, gint row, GValue *value) value_destroy_from_variant (&v, vrnt); } -gboolean myreversefunc (GtkTreeModel *model, gint col, gint row, const gchar *in, - GValue *out); - static void @@ -351,7 +348,7 @@ psppire_data_sheet_new (void) GObject *obj = g_object_new (PSPPIRE_TYPE_DATA_SHEET, "forward-conversion", psppire_data_store_value_to_string, - "reverse-conversion", myreversefunc, + "reverse-conversion", psppire_data_store_string_to_value, "editable", TRUE, "horizontal-draggable", TRUE, NULL); diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 04b6da0858..f97b8eaf1c 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -130,11 +130,13 @@ __iter_nth_child (GtkTreeModel *tree_model, return TRUE; } +/* Set the contents of OUT to reflect the information provided by IN, COL, and + ROW, for MODEL. Returns TRUE if successful. */ gboolean -myreversefunc (GtkTreeModel *model, gint col, gint row, - const gchar *in, GValue *out) +psppire_data_store_string_to_value (GtkTreeModel *model, gint col, gint row, + const gchar *in, GValue *out) { - PsppireDataStore *store = PSPPIRE_DATA_STORE (model); + PsppireDataStore *store = PSPPIRE_DATA_STORE (model); while (col >= psppire_dict_get_var_cnt (store->dict)) { diff --git a/src/ui/gui/psppire-data-store.h b/src/ui/gui/psppire-data-store.h index 65e3d24ad3..efeb886864 100644 --- a/src/ui/gui/psppire-data-store.h +++ b/src/ui/gui/psppire-data-store.h @@ -17,6 +17,7 @@ #ifndef __PSPPIRE_DATA_STORE_H__ #define __PSPPIRE_DATA_STORE_H__ +#include #include "psppire-dict.h" #define FIRST_CASE_NUMBER 1 @@ -113,10 +114,13 @@ gchar * psppire_data_store_value_to_string (gpointer unused, PsppireDataStore *s gint col, gint row, const GValue *v); -gchar * psppire_data_store_value_to_string_with_labels (gpointer unused, PsppireDataStore *store, - gint col, gint row, - const GValue *v); +gchar * psppire_data_store_value_to_string_with_labels (gpointer unused, + PsppireDataStore *store, + gint col, gint row, + const GValue *v); +gboolean psppire_data_store_string_to_value (GtkTreeModel *model, gint col, gint row, + const gchar *in, GValue *out); gboolean psppire_data_store_get_value (PsppireDataStore *store, glong row, const struct variable *var, -- 2.30.2