From 4c1e6e84f6ae53086317561e2e52427a89989aee Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 7 May 2011 14:19:12 -0700 Subject: [PATCH] gui: Only unselect range from first data sheet when data changes. commit 5080068 "gui: Unselect data in data editor when the datasheet is replaced" unselected all the data in each of the possible four datasheets (supposing that the "split" view is selected), but if the "split" view is not in effect then three of the data sheets don't have windows and this results in "Gdk-CRITICAL **: gdk_window_invalidate_rect_full: assertion `GDK_IS_WINDOW (window)' failed". This commit switches to unselecting the range only from the first data sheet, which seems to be just as effective at solving the original problem and does not cause Gdk-CRITICAL messages. --- src/ui/gui/psppire-data-editor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 30098a7e..1c2442d8 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -230,8 +230,8 @@ new_data_callback (PsppireDataStore *ds, gpointer data) the data sheets. If we don't do this, then the sheet remembers the value that was in the selected cell and stores it back, wiping out whatever value there is in the new data. Bug #30502. */ - for (i = 0; i < 4; i++) - psppire_sheet_unselect_range (PSPPIRE_SHEET (de->data_sheet[i])); + if (de->data_sheet[0] != NULL) + psppire_sheet_unselect_range (PSPPIRE_SHEET (de->data_sheet[0])); } static void -- 2.30.2