From 90daf11b95d56e9100f5b5fcaaeb42494ed83e5f Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 6 Oct 2001 17:43:47 +0000 Subject: Check that cell views are realized before doing anything here. Fixes 2001-10-06 Christopher James Lahey * e-table-item.c (eti_show_cursor, eti_check_cursor_bounds): Check that cell views are realized before doing anything here. Fixes Ximian bug #11919. (eti_check_cursor_on_screen): If the cursor values are all set to -1, don't do anything. svn path=/trunk/; revision=13488 --- widgets/table/e-table-item.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'widgets/table') diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index fd51a0407a..dbf4716c5c 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -770,6 +770,9 @@ eti_show_cursor (ETableItem *eti, int delay) { int cursor_row; + if (!((GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) && eti->cell_views_realized)) + return; + gtk_object_get(GTK_OBJECT(eti->selection), "cursor_row", &cursor_row, NULL); @@ -786,6 +789,12 @@ eti_show_cursor (ETableItem *eti, int delay) static void eti_check_cursor_on_screen (ETableItem *eti) { + if (eti->cursor_x1 == -1 || + eti->cursor_y1 == -1 || + eti->cursor_x2 == -1 || + eti->cursor_y2 == -1) + return; + eti->cursor_on_screen = e_canvas_item_area_shown (GNOME_CANVAS_ITEM(eti), eti->cursor_x1, eti->cursor_y1, @@ -800,6 +809,9 @@ eti_check_cursor_bounds (ETableItem *eti) { int x1, y1, x2, y2; int cursor_row; + + if (!((GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) && eti->cell_views_realized)) + return; gtk_object_get(GTK_OBJECT(eti->selection), "cursor_row", &cursor_row, -- cgit