summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-02-13 16:59:56 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-02-13 16:59:56 +0000
commit0bca108a0ab7e081dc57640af3fbf9870749e7b8 (patch)
treebe95bdd126e650769eab20fa33aed71c0a7011cc /pango/pango-attributes.c
parent80d53b6380d64d3bc2c13c6d2fcfe924d45c3d93 (diff)
downloadpango-0bca108a0ab7e081dc57640af3fbf9870749e7b8.tar.gz
properly update the tail of the list (pango_attr_list_change): flip order
2001-02-12 Havoc Pennington <hp@redhat.com> * pango/pango-attributes.c (pango_attr_list_insert_internal): properly update the tail of the list (pango_attr_list_change): flip order of tmp_list2 = tmp_list2->next and prev2 = tmp_list2 to avoid setting prev2 and tmp_list2 to the same value thus creating a mangled list. * pango/pango-layout.c (pango_layout_xy_to_index): When returning FALSE, set the index/trailing to the nearest location, instead of setting them to 0. (pango_layout_line_x_to_index): Fix a bug where line->start_index wasn't used. Return boolean for whether we had to clamp the value to get an index.
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r--pango/pango-attributes.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 9b958672..af04ffed 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -803,6 +803,8 @@ pango_attr_list_insert_internal (PangoAttrList *list,
(!before && ((PangoAttribute *)list->attributes_tail->data)->start_index == start_index))
{
g_slist_append (list->attributes_tail, attr);
+ list->attributes_tail = list->attributes_tail->next;
+ g_assert (list->attributes_tail);
}
else
{
@@ -992,6 +994,9 @@ pango_attr_list_change (PangoAttrList *list,
* tmp_list points to prev->next.
*/
+ g_assert (prev->data == attr);
+ g_assert (prev->next == tmp_list);
+
/* We now have the range inserted into the list one way or the
* other. Fix up the remainder
*/
@@ -1043,8 +1048,8 @@ pango_attr_list_change (PangoAttrList *list,
if (tmp_attr2->start_index >= tmp_attr->start_index)
break;
+ prev2 = tmp_list2;
tmp_list2 = tmp_list2->next;
- prev2 = tmp_list2;
}
/* Now remove and insert before tmp_list2. We'll