]> Pileus Git - ~andy/gtk/commitdiff
(gtk_tree_view_set_column_drag_info): Don't crash if the
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 20 Jun 2006 03:28:36 +0000 (03:28 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 20 Jun 2006 03:28:36 +0000 (03:28 +0000)
column_drop_func says always no.  (#344850, Christian Weiske)

ChangeLog
ChangeLog.pre-2-10
gtk/gtktreeview.c

index dd1f9f84c4406deb94b82364f5e61113b5559ec8..2db93cb63a38591c472fc55311937eef352ce662 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,9 @@
 
        * gtk/gtktreeview.c (gtk_tree_view_set_grid_lines): Don't leak
        dash_list.
-
+       (gtk_tree_view_set_column_drag_info): Don't crash if the 
+       column_drop_func says always no.  (#344850, Christian Weiske)
+       
        Make transparent tray icons work.  (#320034, based on a 
        patch by Dan Winship)
        
index dd1f9f84c4406deb94b82364f5e61113b5559ec8..2db93cb63a38591c472fc55311937eef352ce662 100644 (file)
@@ -2,7 +2,9 @@
 
        * gtk/gtktreeview.c (gtk_tree_view_set_grid_lines): Don't leak
        dash_list.
-
+       (gtk_tree_view_set_column_drag_info): Don't crash if the 
+       column_drop_func says always no.  (#344850, Christian Weiske)
+       
        Make transparent tray icons work.  (#320034, based on a 
        patch by Dan Winship)
        
index aa670a8a9fb5d70a32601fa333664d67dd73850a..4307f9c7d0e63a6bcfc663385d53d0d6c43f7e21 100644 (file)
@@ -9028,9 +9028,10 @@ gtk_tree_view_set_column_drag_info (GtkTreeView       *tree_view,
 
   /* We know there are always 2 slots possbile, as you can always return column. */
   /* If that's all there is, return */
-  if (tree_view->priv->column_drag_info->next->next == NULL &&
-      ((GtkTreeViewColumnReorder *)tree_view->priv->column_drag_info->data)->right_column == column &&
-      ((GtkTreeViewColumnReorder *)tree_view->priv->column_drag_info->next->data)->left_column == column)
+  if (g_list_length (tree_view->priv->column_drag_info) < 2 || 
+      (tree_view->priv->column_drag_info->next->next == NULL &&
+       ((GtkTreeViewColumnReorder *)tree_view->priv->column_drag_info->data)->right_column == column &&
+       ((GtkTreeViewColumnReorder *)tree_view->priv->column_drag_info->next->data)->left_column == column))
     {
       for (tmp_list = tree_view->priv->column_drag_info; tmp_list; tmp_list = tmp_list->next)
        g_free (tmp_list->data);