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.
This commit is contained in:
Jonathan Blandford 2001-11-02 00:13:30 +00:00 committed by Jonathan Blandford
parent 2ced30ad32
commit a2ff9e4179
10 changed files with 91 additions and 15 deletions

View File

@ -1,3 +1,11 @@
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.
Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint. * gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint.

View File

@ -1,3 +1,11 @@
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.
Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint. * gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint.

View File

@ -1,3 +1,11 @@
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.
Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint. * gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint.

View File

@ -1,3 +1,11 @@
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.
Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint. * gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint.

View File

@ -1,3 +1,11 @@
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.
Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint. * gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint.

View File

@ -1,3 +1,11 @@
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.
Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint. * gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint.

View File

@ -1,3 +1,11 @@
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.
Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com> Thu Nov 1 16:54:00 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint. * gtk/gtktypeutils.h: Make GtkFunction return boolean, not gint.

View File

@ -805,6 +805,7 @@ typedef struct _GtkRBReorder
gint flags; gint flags;
gint order; gint order;
gint invert_order; gint invert_order;
gint parity;
} GtkRBReorder; } GtkRBReorder;
static int static int
@ -828,19 +829,26 @@ gtk_rbtree_reorder_fixup (GtkRBTree *tree,
if (node == tree->nil) if (node == tree->nil)
return; return;
node->parity = 1;
if (node->left != tree->nil) if (node->left != tree->nil)
{ {
gtk_rbtree_reorder_fixup (tree, node->left); gtk_rbtree_reorder_fixup (tree, node->left);
node->offset += node->left->offset; node->offset += node->left->offset;
node->parity += node->left->parity;
} }
if (node->right != tree->nil) if (node->right != tree->nil)
{ {
gtk_rbtree_reorder_fixup (tree, node->right); gtk_rbtree_reorder_fixup (tree, node->right);
node->offset += node->right->offset; node->offset += node->right->offset;
node->parity += node->right->parity;
} }
if (node->children) 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 /* 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 * 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. * anyone wants to spend the time writing it, patches will be accepted.
*/ */
void void
_gtk_rbtree_reorder (GtkRBTree *tree, _gtk_rbtree_reorder (GtkRBTree *tree,
gint *new_order, gint *new_order,

View File

@ -230,7 +230,8 @@ gtk_tree_selection_set_mode (GtkTreeSelection *selection,
tree, tree,
anchor_path, anchor_path,
0); 0);
gtk_tree_path_free (anchor_path); if (anchor_path)
gtk_tree_path_free (anchor_path);
} }
selection->type = type; selection->type = type;

View File

@ -7987,20 +7987,32 @@ gtk_tree_view_set_reorderable (GtkTreeView *tree_view,
{ {
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
if (tree_view->priv->reorderable == (reorderable?TRUE:FALSE)) reorderable = reorderable != FALSE;
if (tree_view->priv->reorderable == reorderable)
return; return;
gtk_tree_view_set_rows_drag_source (tree_view, tree_view->priv->reorderable = reorderable;
GDK_BUTTON1_MASK,
row_targets, if (reorderable)
G_N_ELEMENTS (row_targets), {
GDK_ACTION_MOVE, gtk_tree_view_set_rows_drag_source (tree_view,
NULL, NULL); GDK_BUTTON1_MASK,
gtk_tree_view_set_rows_drag_dest (tree_view, row_targets,
row_targets, G_N_ELEMENTS (row_targets),
G_N_ELEMENTS (row_targets), GDK_ACTION_MOVE,
GDK_ACTION_MOVE, NULL, NULL);
NULL, NULL); gtk_tree_view_set_rows_drag_dest (tree_view,
row_targets,
G_N_ELEMENTS (row_targets),
GDK_ACTION_MOVE,
NULL, NULL);
}
else
{
gtk_tree_view_unset_rows_drag_source (tree_view);
gtk_tree_view_unset_rows_drag_dest (tree_view);
}
g_object_notify (G_OBJECT (tree_view), "reorderable"); g_object_notify (G_OBJECT (tree_view), "reorderable");
} }