From d23a0b0820ff5ea37e9dd71b3589039760e230c9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 2 Sep 2014 18:18:21 -0400 Subject: PangoGlyphItem: Better treatment of ellipsized runs When we reapply non-shape attributes, we must take care to not add any attributes that start in the middle of an ellipsized run, or we end up with a blue, underlined ellipsis if there is a link anywhere inside the ellipsized text. https://bugzilla.gnome.org/show_bug.cgi?id=735732 --- pango/pango-glyph-item.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c index 98b06b8b..647a31f3 100644 --- a/pango/pango-glyph-item.c +++ b/pango/pango-glyph-item.c @@ -582,6 +582,7 @@ pango_glyph_item_apply_attrs (PangoGlyphItem *glyph_item, gboolean start_new_segment = FALSE; gboolean have_cluster; int range_start, range_end; + gboolean is_ellipsis; /* This routine works by iterating through the item cluster by * cluster; we accumulate the attributes that we need to @@ -608,11 +609,14 @@ pango_glyph_item_apply_attrs (PangoGlyphItem *glyph_item, state.segment_attrs = pango_attr_iterator_get_attrs (iter); + is_ellipsis = (glyph_item->item->analysis.flags & PANGO_ANALYSIS_FLAG_IS_ELLIPSIS) != 0; + /* Short circuit the case when we don't actually need to * split the item */ - if (range_start <= glyph_item->item->offset && - range_end >= glyph_item->item->offset + glyph_item->item->length) + if (is_ellipsis || + (range_start <= glyph_item->item->offset && + range_end >= glyph_item->item->offset + glyph_item->item->length)) goto out; for (have_cluster = pango_glyph_item_iter_init_start (&state.iter, glyph_item, text); -- cgit v1.2.1