From 4ad4fcab6c886b1a6f29769a374b67b2f60173a9 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 4 Sep 2017 18:40:02 +0200 Subject: [PATCH] Set the cell value when the reference entry changes --- src/ui/gui/psppire-data-editor.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 27a4b63ab3..0efd8ce835 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -345,8 +345,23 @@ refresh_entry (PsppireDataEditor *de) } static void -on_datum_entry_activate (PsppireValueEntry *entry, PsppireDataEditor *de) +on_datum_entry_activate (GtkEntry *entry, PsppireDataEditor *de) { + gint row, col; + if (ssw_sheet_get_active_cell (SSW_SHEET (de->data_sheet), &col, &row)) + { + union value val; + const struct variable *var = psppire_dict_get_variable (de->dict, col); + if (var == NULL) + return; + + value_init (&val, var_get_width (var)); + + if (psppire_value_entry_get_value (de->datum_entry, &val, var_get_width (var))) + { + psppire_data_store_set_value (de->data_store, row, var, &val); + } + } } -- 2.30.2