From ddc0dc65f57f8a01f2744becf35a08eb4ef8e848 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 4 May 2004 09:26:17 +0000 Subject: revert last patch. (eti_attach_cell_views): add some code to reset drags 2004-05-04 Not Zed * e-table-item.c (eti_event): revert last patch. (eti_attach_cell_views): add some code to reset drags and other things as if the model changed, so we don't keep trying to run things we shouldn't be on the view which might be changing. This may break other things but should fix 57222 and related. svn path=/trunk/; revision=25779 --- widgets/table/e-table-item.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'widgets') diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 8a9956a614..6e3ef8ddf1 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -60,6 +60,9 @@ #define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x))) #endif +static void eti_check_cursor_bounds (ETableItem *eti); +static void eti_cancel_drag_due_to_model_change (ETableItem *eti); + /* FIXME: Do an analysis of which cell functions are needed before realize and make sure that all of them are doable by all the cells and that all of the others are only done after realization. */ @@ -354,6 +357,14 @@ eti_attach_cell_views (ETableItem *eti) g_assert (eti->header); g_assert (eti->table_model); + /* this is just c&p from model pre change, but it fixes things */ + eti_cancel_drag_due_to_model_change (eti); + eti_check_cursor_bounds (eti); + if (eti_editing (eti)) + e_table_item_leave_edit_(eti); + eti->motion_row = -1; + eti->motion_col = -1; + /* * Now realize the various ECells */ @@ -2551,8 +2562,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) return TRUE; if (eti->motion_row != -1 && eti->motion_col != -1 && - (row != eti->motion_row || col != eti->motion_col) - && eti->motion_col < eti->n_cells) { + (row != eti->motion_row || col != eti->motion_col)) { GdkEvent *cross = gdk_event_new (GDK_LEAVE_NOTIFY); cross->crossing.time = e->motion.time; return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col], -- cgit v1.2.3