From: Friedrich Beckmann <friedrich.beckmann@gmx.de>
Date: Sun, 31 May 2020 22:39:59 +0000 (+0200)
Subject: insert variables in var view (#55357)
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e870838d34e5e0133997434d27035054c605fb4f;p=pspp

insert variables in var view (#55357)

The variable insert procedure inserted new variables
via the datasheet window even if the variable
window was visible. Directly after startup the
dataview is not realized and that prevents a correct
update of the variable view. I changed the procedure
such that the ssw items_changed_cb is called for
the widgets in the variable view and the window
is correctly updated.
---

diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c
index 08c7375a67..c06502f203 100644
--- a/src/ui/gui/psppire-data-window.c
+++ b/src/ui/gui/psppire-data-window.c
@@ -1180,7 +1180,10 @@ insert_variable (PsppireDataWindow *dw)
   else
     {
       SswRange *range = SSW_SHEET(de->var_sheet)->selection;
-      psppire_data_editor_insert_new_variable_at_posn (de, range->start_y);
+      PsppireDict *dict = NULL;
+      g_object_get (de->var_sheet, "data-model", &dict, NULL);
+      psppire_dict_insert_variable (dict, range->start_y, NULL);
+      gtk_widget_queue_draw (GTK_WIDGET (de->var_sheet));
     }
 }