From: John Darrington Date: Fri, 28 Nov 2008 22:35:54 +0000 (+0900) Subject: Dont try to draw cells outside the valid range X-Git-Tag: v0.7.1~98 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91c33245d6f01fae50020756be21774ac23eb2d7;p=pspp-builds.git Dont try to draw cells outside the valid range --- diff --git a/lib/gtksheet/gtksheet.c b/lib/gtksheet/gtksheet.c index 28279076..ad56c665 100644 --- a/lib/gtksheet/gtksheet.c +++ b/lib/gtksheet/gtksheet.c @@ -2572,6 +2572,12 @@ change_active_cell (GtkSheet *sheet, gint row, gint col) r.row0 = old_row - 1; r.rowi = old_row + 1; + maximize_int (&r.row0, 0); + maximize_int (&r.col0, 0); + minimize_int (&r.rowi, psppire_axis_unit_count (sheet->vaxis) - 1); + minimize_int (&r.coli, psppire_axis_unit_count (sheet->haxis) - 1); + + if ( gtk_sheet_range_isvisible (sheet, &r)) gtk_sheet_range_draw (sheet, &r); }