From: John Darrington Date: Mon, 4 Sep 2017 16:40:02 +0000 (+0200) Subject: Set the cell value when the reference entry changes X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=4ad4fcab6c886b1a6f29769a374b67b2f60173a9 Set the cell value when the reference entry changes --- 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); + } + } }