summaryrefslogtreecommitdiff
path: root/gtk/gtkrbtree.c
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2001-11-02 00:13:30 +0000
committerJonathan Blandford <jrb@src.gnome.org>2001-11-02 00:13:30 +0000
commita2ff9e41790763ee5196b3ffde6b5b297bdb1d4a (patch)
tree37da0ebf46d00f5a6ecf52f41933ddc7f7c72364 /gtk/gtkrbtree.c
parent2ced30ad322a10e1b048780a0713c552645790d9 (diff)
downloadgtk+-a2ff9e41790763ee5196b3ffde6b5b297bdb1d4a.tar.gz
Fix reorder_fixup, #59583
Thu Nov 1 19:11:35 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtkrbtree.c (gtk_rbtree_reorder_fixup): Fix reorder_fixup, #59583 * gtk/gtktreeselection.c (gtk_tree_selection_set_mode): fix warning.
Diffstat (limited to 'gtk/gtkrbtree.c')
-rw-r--r--gtk/gtkrbtree.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/gtkrbtree.c b/gtk/gtkrbtree.c
index c07d6b4527..82768e7cfa 100644
--- a/gtk/gtkrbtree.c
+++ b/gtk/gtkrbtree.c
@@ -805,6 +805,7 @@ typedef struct _GtkRBReorder
gint flags;
gint order;
gint invert_order;
+ gint parity;
} GtkRBReorder;
static int
@@ -828,19 +829,26 @@ gtk_rbtree_reorder_fixup (GtkRBTree *tree,
if (node == tree->nil)
return;
+ node->parity = 1;
+
if (node->left != tree->nil)
{
gtk_rbtree_reorder_fixup (tree, node->left);
node->offset += node->left->offset;
+ node->parity += node->left->parity;
}
if (node->right != tree->nil)
{
gtk_rbtree_reorder_fixup (tree, node->right);
node->offset += node->right->offset;
+ node->parity += node->right->parity;
}
if (node->children)
- node->offset += node->children->root->offset;
+ {
+ node->offset += node->children->root->offset;
+ node->parity += node->children->root->parity;
+ }
}
/* It basically pulls everything out of the tree, rearranges it, and puts it
@@ -849,7 +857,6 @@ gtk_rbtree_reorder_fixup (GtkRBTree *tree,
* heights. There is probably a more elegant way to write this function. If
* anyone wants to spend the time writing it, patches will be accepted.
*/
-
void
_gtk_rbtree_reorder (GtkRBTree *tree,
gint *new_order,