diff options
author | Havoc Pennington <hp@pobox.com> | 2001-02-13 05:44:47 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2001-02-13 05:44:47 +0000 |
commit | 2097d764a7a60f87a0ca4c43720f3e2644652a14 (patch) | |
tree | 5ce16eb25b20f4f6993b003c8e35e4eaf2f9b3c8 /gtk/gtktextbtree.c | |
parent | 41b2d039af6f972a5c442d860277164f90fb9ccb (diff) | |
download | gtk+-2097d764a7a60f87a0ca4c43720f3e2644652a14.tar.gz |
fix bug where it always set the foreground, even if we were only using a
2001-02-12 Havoc Pennington <hp@pobox.com>
* gdk/gdkpango.c (gdk_pango_get_gc): fix bug where
it always set the foreground, even if we were only using
a stipple.
(gdk_draw_layout_line_with_colors): new function, allow
override colors
(gdk_draw_layout_with_colors): new function, allow override
colors
(gdk_pango_layout_line_get_clip_region): function to get the clip
region for a logical text range
(gdk_pango_layout_get_clip_region): get the clip region for a
logical text range
* gdk/x11/gdkcolor-x11.c: forward declare gdk_colormap_sync(),
(gdk_colormap_new): fix call to gdk_colormap_sync() so it has
the right number of arguments.
* gtk/gtktextbtree.c (gtk_text_btree_node_check_consistency):
enhance the function to check that node data corresponds to a
view still belonging to the tree.
* gtk/gtktreeview.c (gtk_tree_view_changed): we were leaking the
GtkTreePath
(gtk_tree_view_inserted): ditto
(gtk_tree_view_child_toggled): ditto
* gtk/gtktreemodel.c (gtk_tree_path_append_index): use realloc to
simplify this code.
* gtk/gtkcellrenderertext.c (get_layout): fix leak of
a PangoAttrList
* demos/gtk-demo/main.c (load_file): Fix leak of a GString
* gtk/gtkentry.c (gtk_entry_realize): Fix leak of a GdkCursor
* gtk/gtkmenubar.c (gtk_menu_bar_size_request): consider toggle
size in the size request
(gtk_menu_bar_size_allocate): consider toggle size here
* gtk/gtkimagemenuitem.h, gtkimagemenuitem.c: Menu item
that displays a widget in the toggle slot
* gtk/testgtk.c: test GtkImageMenuItem
* gtk/Makefile.am, gtk/gtk.h: Add GtkImageMenuItem
* gtk/gtkmenuitem.h: Use "gint" not "guint16" for toggle size
request and allocation
* gtk/gtkmenu.c (gtk_menu_size_request): use gint not guint16
* gtk/gtkcheckmenuitem.c
(gtk_check_menu_item_toggle_size_request): ditto
Diffstat (limited to 'gtk/gtktextbtree.c')
-rw-r--r-- | gtk/gtktextbtree.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c index d6bd9bca99..5cf5f889a1 100644 --- a/gtk/gtktextbtree.c +++ b/gtk/gtktextbtree.c @@ -5129,14 +5129,15 @@ gtk_text_btree_node_ensure_data (GtkTextBTreeNode *node, gpointer view_id) nd = nd->next; } - if (nd == NULL) { - nd = node_data_new (view_id); - - if (node->node_data) - nd->next = node->node_data; - - node->node_data = nd; - } + if (nd == NULL) + { + nd = node_data_new (view_id); + + if (node->node_data) + nd->next = node->node_data; + + node->node_data = nd; + } return nd; } @@ -5798,7 +5799,7 @@ recompute_node_counts (GtkTextBTree *tree, GtkTextBTreeNode *node) gtk_text_btree_node_check_valid (node, view->view_id); view = view->next; } - + /* * Scan through the GtkTextBTreeNode's tag records again and delete any Summary * records that still have a zero count, or that have all the toggles. @@ -6221,13 +6222,29 @@ _gtk_toggle_segment_check_func (GtkTextLineSegment *segPtr, */ static void -gtk_text_btree_node_view_check_consistency (GtkTextBTreeNode *node, +gtk_text_btree_node_view_check_consistency (GtkTextBTree *tree, + GtkTextBTreeNode *node, NodeData *nd) { gint width; gint height; gboolean valid; + BTreeView *view; + + view = tree->views; + + while (view != NULL) + { + if (view->view_id == nd->view_id) + break; + view = view->next; + } + + if (view == NULL) + g_error ("Node has data for a view %p no longer attached to the tree", + nd->view_id); + gtk_text_btree_node_compute_view_aggregates (node, nd->view_id, &width, &height, &valid); if (nd->width != width || @@ -6243,7 +6260,8 @@ gtk_text_btree_node_view_check_consistency (GtkTextBTreeNode *node, } static void -gtk_text_btree_node_check_consistency (GtkTextBTreeNode *node) +gtk_text_btree_node_check_consistency (GtkTextBTree *tree, + GtkTextBTreeNode *node) { GtkTextBTreeNode *childnode; Summary *summary, *summary2; @@ -6274,7 +6292,7 @@ gtk_text_btree_node_check_consistency (GtkTextBTreeNode *node) nd = node->node_data; while (nd != NULL) { - gtk_text_btree_node_view_check_consistency (node, nd); + gtk_text_btree_node_view_check_consistency (tree, node, nd); nd = nd->next; } @@ -6343,7 +6361,7 @@ gtk_text_btree_node_check_consistency (GtkTextBTreeNode *node) g_error ("gtk_text_btree_node_check_consistency: level mismatch (%d %d)", node->level, childnode->level); } - gtk_text_btree_node_check_consistency (childnode); + gtk_text_btree_node_check_consistency (tree, childnode); for (summary = childnode->summary; summary != NULL; summary = summary->next) { @@ -6579,7 +6597,7 @@ _gtk_text_btree_check (GtkTextBTree *tree) */ node = tree->root_node; - gtk_text_btree_node_check_consistency (tree->root_node); + gtk_text_btree_node_check_consistency (tree, tree->root_node); /* * Make sure that there are at least two lines in the text and |