summaryrefslogtreecommitdiff
path: root/gtk/gtktextbtree.c
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2004-07-23 15:01:50 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-07-23 15:01:50 +0000
commit74d62a92ea135b880c96ff7cb27b6f7a4687b2ee (patch)
treed08fc7942ed133a0985a08f99f9da35cf36f87cf /gtk/gtktextbtree.c
parenta35539698a3198861638badc4e3b94d61add7622 (diff)
downloadgtk+-74d62a92ea135b880c96ff7cb27b6f7a4687b2ee.tar.gz
Don't iterate too far up. (#147965, Olivier Sessink)
Fri Jul 23 11:00:17 2004 Matthias Clasen <maclas@gmx.de> * gtk/gtktextbtree.c (_gtk_text_line_previous_could_contain_tag): Don't iterate too far up. (#147965, Olivier Sessink)
Diffstat (limited to 'gtk/gtktextbtree.c')
-rw-r--r--gtk/gtktextbtree.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c
index 663207e641..3f5dc5fee8 100644
--- a/gtk/gtktextbtree.c
+++ b/gtk/gtktextbtree.c
@@ -4487,8 +4487,7 @@ _gtk_text_line_previous_could_contain_tag (GtkTextLine *line,
line_ancestor = line->parent;
line_ancestor_parent = line->parent->parent;
- node = line_ancestor_parent->children.node;
- while (node != line_ancestor || line_ancestor != info->tag_root)
+ while (line_ancestor != info->tag_root)
{
GSList *child_nodes = NULL;
GSList *tmp;
@@ -4496,6 +4495,11 @@ _gtk_text_line_previous_could_contain_tag (GtkTextLine *line,
/* Create reverse-order list of nodes before
* line_ancestor
*/
+ if (line_ancestor_parent != NULL)
+ node = line_ancestor_parent->children.node;
+ else
+ node = line_ancestor;
+
while (node != line_ancestor && node != NULL)
{
child_nodes = g_slist_prepend (child_nodes, node);
@@ -4526,11 +4530,6 @@ _gtk_text_line_previous_could_contain_tag (GtkTextLine *line,
/* Didn't find anything on this level; go up one level. */
line_ancestor = line_ancestor_parent;
line_ancestor_parent = line_ancestor->parent;
-
- if (line_ancestor_parent != NULL)
- {
- node = line_ancestor_parent->children.node;
- }
}
/* No dice. */