diff options
-rw-r--r-- | widgets/e-table/ChangeLog | 9 | ||||
-rw-r--r-- | widgets/e-table/e-table-header-item.c | 14 | ||||
-rw-r--r-- | widgets/table/e-table-header-item.c | 14 |
3 files changed, 37 insertions, 0 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index 5b1077a7ab..9425282dd9 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,3 +1,12 @@ +2000-02-12 Iain Holmes <ih@csd.abdn.ac.uk> + + * e-table-header-item.c (ethi_drag_motion): Check the ethi is actually + the one being dragged. Prevents crashes when trying to drag headeritems + and there are multiple headeritems on the same canvas. + (ethi_drag_end): Same. + (ethi_drag_drop): Same. + (ethi_drag_leave): Same. + 2000-02-11 Christopher James Lahey <clahey@helixcode.com> * test-check.c: Added test of sort arrows. diff --git a/widgets/e-table/e-table-header-item.c b/widgets/e-table/e-table-header-item.c index 039015b3ec..b025664385 100644 --- a/widgets/e-table/e-table-header-item.c +++ b/widgets/e-table/e-table-header-item.c @@ -315,6 +315,10 @@ ethi_drag_motion (GtkObject *canvas, GdkDragContext *context, gint x, gint y, guint time, ETableHeaderItem *ethi) { + /* Check if it's the correct ethi */ + if (ethi->drag_col == -1) + return; + gdk_drag_status (context, 0, time); if (GTK_WIDGET(canvas) == gtk_drag_get_source_widget(context)) { if ((x >= ethi->x1) && (x <= (ethi->x1 + ethi->width)) && @@ -343,6 +347,9 @@ ethi_drag_motion (GtkObject *canvas, GdkDragContext *context, static void ethi_drag_end (GtkWidget *canvas, GdkDragContext *context, ETableHeaderItem *ethi) { + if (ethi->drag_col == -1) + return; + if (canvas == gtk_drag_get_source_widget(context)) { if (context->action == 0) { ethi_request_redraw (ethi); @@ -363,6 +370,10 @@ ethi_drag_drop (GtkWidget *canvas, ETableHeaderItem *ethi) { gboolean successful = FALSE; + + if (ethi->drag_col == -1) + return; + if (GTK_WIDGET(canvas) == gtk_drag_get_source_widget(context)) { if ((x >= ethi->x1) && (x <= (ethi->x1 + ethi->width)) && (y >= ethi->y1) && (y <= (ethi->y1 + ethi->height))){ @@ -387,6 +398,9 @@ ethi_drag_drop (GtkWidget *canvas, static void ethi_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, ETableHeaderItem *ethi) { + if (ethi->drag_col == -1) + return; + if (widget == gtk_drag_get_source_widget(context)) { ethi_remove_drop_marker (ethi); ethi_add_destroy_marker (ethi); diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 039015b3ec..b025664385 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -315,6 +315,10 @@ ethi_drag_motion (GtkObject *canvas, GdkDragContext *context, gint x, gint y, guint time, ETableHeaderItem *ethi) { + /* Check if it's the correct ethi */ + if (ethi->drag_col == -1) + return; + gdk_drag_status (context, 0, time); if (GTK_WIDGET(canvas) == gtk_drag_get_source_widget(context)) { if ((x >= ethi->x1) && (x <= (ethi->x1 + ethi->width)) && @@ -343,6 +347,9 @@ ethi_drag_motion (GtkObject *canvas, GdkDragContext *context, static void ethi_drag_end (GtkWidget *canvas, GdkDragContext *context, ETableHeaderItem *ethi) { + if (ethi->drag_col == -1) + return; + if (canvas == gtk_drag_get_source_widget(context)) { if (context->action == 0) { ethi_request_redraw (ethi); @@ -363,6 +370,10 @@ ethi_drag_drop (GtkWidget *canvas, ETableHeaderItem *ethi) { gboolean successful = FALSE; + + if (ethi->drag_col == -1) + return; + if (GTK_WIDGET(canvas) == gtk_drag_get_source_widget(context)) { if ((x >= ethi->x1) && (x <= (ethi->x1 + ethi->width)) && (y >= ethi->y1) && (y <= (ethi->y1 + ethi->height))){ @@ -387,6 +398,9 @@ ethi_drag_drop (GtkWidget *canvas, static void ethi_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, ETableHeaderItem *ethi) { + if (ethi->drag_col == -1) + return; + if (widget == gtk_drag_get_source_widget(context)) { ethi_remove_drop_marker (ethi); ethi_add_destroy_marker (ethi); |