]> Pileus Git - ~andy/gtk/commitdiff
Fix stale pointer bug.
authorDarin Adler <darin@src.gnome.org>
Fri, 8 Feb 2002 23:26:29 +0000 (23:26 +0000)
committerDarin Adler <darin@src.gnome.org>
Fri, 8 Feb 2002 23:26:29 +0000 (23:26 +0000)
* gtk/gtktreeview.c: (gtk_tree_view_map_expanded_rows_helper):
Fix stale pointer bug.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreeview.c

index 3b6d5375dc2a4b22a56bde8504bd5e97659c0afb..94ca9f2e723ce5bc46860ad59c515b4398d4baa6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-08  Darin Adler  <darin@bentspoon.com>
+
+       * gtk/gtktreeview.c: (gtk_tree_view_map_expanded_rows_helper):
+       Fix stale pointer bug.
+
 Fri Feb  8 14:30:14 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (title_focus_in): Return FALSE if
index 3b6d5375dc2a4b22a56bde8504bd5e97659c0afb..94ca9f2e723ce5bc46860ad59c515b4398d4baa6 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Darin Adler  <darin@bentspoon.com>
+
+       * gtk/gtktreeview.c: (gtk_tree_view_map_expanded_rows_helper):
+       Fix stale pointer bug.
+
 Fri Feb  8 14:30:14 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (title_focus_in): Return FALSE if
index 3b6d5375dc2a4b22a56bde8504bd5e97659c0afb..94ca9f2e723ce5bc46860ad59c515b4398d4baa6 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Darin Adler  <darin@bentspoon.com>
+
+       * gtk/gtktreeview.c: (gtk_tree_view_map_expanded_rows_helper):
+       Fix stale pointer bug.
+
 Fri Feb  8 14:30:14 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (title_focus_in): Return FALSE if
index 3b6d5375dc2a4b22a56bde8504bd5e97659c0afb..94ca9f2e723ce5bc46860ad59c515b4398d4baa6 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Darin Adler  <darin@bentspoon.com>
+
+       * gtk/gtktreeview.c: (gtk_tree_view_map_expanded_rows_helper):
+       Fix stale pointer bug.
+
 Fri Feb  8 14:30:14 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (title_focus_in): Return FALSE if
index 3b6d5375dc2a4b22a56bde8504bd5e97659c0afb..94ca9f2e723ce5bc46860ad59c515b4398d4baa6 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Darin Adler  <darin@bentspoon.com>
+
+       * gtk/gtktreeview.c: (gtk_tree_view_map_expanded_rows_helper):
+       Fix stale pointer bug.
+
 Fri Feb  8 14:30:14 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (title_focus_in): Return FALSE if
index 3b6d5375dc2a4b22a56bde8504bd5e97659c0afb..94ca9f2e723ce5bc46860ad59c515b4398d4baa6 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Darin Adler  <darin@bentspoon.com>
+
+       * gtk/gtktreeview.c: (gtk_tree_view_map_expanded_rows_helper):
+       Fix stale pointer bug.
+
 Fri Feb  8 14:30:14 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (title_focus_in): Return FALSE if
index 3b6d5375dc2a4b22a56bde8504bd5e97659c0afb..94ca9f2e723ce5bc46860ad59c515b4398d4baa6 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Darin Adler  <darin@bentspoon.com>
+
+       * gtk/gtktreeview.c: (gtk_tree_view_map_expanded_rows_helper):
+       Fix stale pointer bug.
+
 Fri Feb  8 14:30:14 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkclist.c (title_focus_in): Return FALSE if
index bb9c29702672d636521f0e6fe7ff8232a634cdbd..867e8ac732a87838f5cdfa2b4b8fffa1f654795b 100644 (file)
@@ -3289,7 +3289,7 @@ validate_visible_area (GtkTreeView *tree_view)
                                                    &iter,
                                                    &parent);
          TREE_VIEW_INTERNAL_ASSERT_VOID (has_child);
-         gtk_tree_path_append_index (path, 0);
+         gtk_tree_path_down (path);
        }
       else
        {
@@ -3904,7 +3904,7 @@ get_logical_dest_row (GtkTreeView *tree_view)
            pos == GTK_TREE_VIEW_DROP_INTO_OR_AFTER)
     {
       /* get first child, drop before it */
-      gtk_tree_path_append_index (path, 0);
+      gtk_tree_path_down (path);
     }
   else
     {
@@ -7787,7 +7787,7 @@ gtk_tree_view_collapse_all (GtkTreeView *tree_view)
   g_return_if_fail (tree_view->priv->tree != NULL);
 
   path = gtk_tree_path_new ();
-  gtk_tree_path_append_index (path, 0);
+  gtk_tree_path_down (path);
   indices = gtk_tree_path_get_indices (path);
 
   tree = tree_view->priv->tree;
@@ -7978,7 +7978,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view,
       GtkTreePath *child_path;
       gint child_count = 0;
       child_path = gtk_tree_path_copy (path);
-      gtk_tree_path_append_index (child_path, 0);
+      gtk_tree_path_down (child_path);
       if (node->children)
        _gtk_rbtree_traverse (node->children, node->children->root, G_POST_ORDER, count_children_helper, &child_count);
       (* tree_view->priv->destroy_count_func) (tree_view, child_path, child_count, tree_view->priv->destroy_count_data);
@@ -8103,8 +8103,6 @@ gtk_tree_view_map_expanded_rows_helper (GtkTreeView            *tree_view,
                                        gpointer                user_data)
 {
   GtkRBNode *node;
-  gint *indices;
-  gint depth;
   gint i = 0;
 
   if (tree == NULL || tree->root == NULL)
@@ -8112,9 +8110,6 @@ gtk_tree_view_map_expanded_rows_helper (GtkTreeView            *tree_view,
 
   node = tree->root;
 
-  indices = gtk_tree_path_get_indices (path);
-  depth = gtk_tree_path_get_depth (path);
-
   while (node && node->left != tree->nil)
     node = node->left;
 
@@ -8122,13 +8117,13 @@ gtk_tree_view_map_expanded_rows_helper (GtkTreeView            *tree_view,
     {
       if (node->children)
        {
-         gtk_tree_path_append_index (path, 0);
+         gtk_tree_path_down (path);
          gtk_tree_view_map_expanded_rows_helper (tree_view, node->children, path, func, user_data);
          gtk_tree_path_up (path);
          (* func) (tree_view, path, user_data);
        }
       i++;
-      indices[depth -1] = i;
+      gtk_tree_path_next (path);
       node = _gtk_rbtree_next (tree, node);
     }
 }
@@ -9521,7 +9516,7 @@ gtk_tree_view_search_iter (GtkTreeModel     *model,
 
          tmp = *iter;
          has_child = gtk_tree_model_iter_children (model, iter, &tmp);
-         gtk_tree_path_append_index (path, 0);
+         gtk_tree_path_down (path);
 
          /* sanity check */
          TREE_VIEW_INTERNAL_ASSERT (has_child, FALSE);