From: Ben Pfaff Date: Sat, 7 May 2011 21:19:12 +0000 (-0700) Subject: gui: Only unselect range from first data sheet when data changes. X-Git-Tag: v0.7.9~311 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c1e6e84f6ae53086317561e2e52427a89989aee;p=pspp-builds.git 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. --- 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