Bug (cosmetic) in GtkCTree (1.2.8)



Hi,

Came across a (minor) bug in GtkCTree. Doesn't cause any functionality
probs, but it
does generate a spurious warning.

This is in GTK+ 1.2.8, so it may have been fixed in CVS.

If you move a row using gtk_ctree_move AND the row you're moving isn't
visible AND you
are moving it to the end of the 'branch' (new_sibling == NULL), you get:

Gtk-CRITICAL **: file gtkctree.c: line 4051 (gtk_ctree_is_viewable):
assertion `node != NULL' failed.

This is because (in gtkctree.c:real_tree_move) at ~line 2417, the 'lazy
OR':
  if (gtk_ctree_is_viewable (ctree, node) ||
      gtk_ctree_is_viewable (ctree, new_sibling))

will evaluate the second half of the expression if the branch is
collapsed, but
new_sibling == NULL is a valid invocation of gtk_ctree_move(). I reckon
the fix is to
check for new_sibling == NULL in real_tree_move .... ?

Diff -c attached ....

Allan

*** gtkctree.c.orig     Mon Oct  2 17:17:38 2000
--- gtkctree.c  Mon Oct  2 17:30:09 2000
***************
*** 2414,2420 ****
  
    work = NULL;
    if (gtk_ctree_is_viewable (ctree, node) ||
!       gtk_ctree_is_viewable (ctree, new_sibling))
      work = GTK_CTREE_NODE (g_list_nth (clist->row_list,
clist->focus_row));
        
    gtk_ctree_unlink (ctree, node, FALSE);
--- 2414,2420 ----
  
    work = NULL;
    if (gtk_ctree_is_viewable (ctree, node) ||
!       (new_sibling != NULL && gtk_ctree_is_viewable (ctree,
new_sibling)))
      work = GTK_CTREE_NODE (g_list_nth (clist->row_list,
clist->focus_row));
        
    gtk_ctree_unlink (ctree, node, FALSE);




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]