aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorIain Holmes <ih@csd.abdn.ac.uk>2000-02-13 04:36:48 +0800
committeriholmes <iholmes@localhost>2000-02-13 04:36:48 +0800
commite07a05c550c1382031b7e57cf39765bb12165b85 (patch)
tree3364bd4b4d3a113c347da430cc20b81c80f8c0a4 /widgets/table
parent29201b7558928f5b8319b054a4a0bf76429a4807 (diff)
downloadgsoc2013-evolution-e07a05c550c1382031b7e57cf39765bb12165b85.tar.gz
gsoc2013-evolution-e07a05c550c1382031b7e57cf39765bb12165b85.tar.zst
gsoc2013-evolution-e07a05c550c1382031b7e57cf39765bb12165b85.zip
Check the ethi is actually the one being dragged. Prevents crashes when
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. svn path=/trunk/; revision=1745
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-table-header-item.c14
1 files changed, 14 insertions, 0 deletions
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);