summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-01-20 22:06:32 -0500
committerMatthias Clasen <mclasen@redhat.com>2022-01-20 22:10:57 -0500
commitdd8e718e1997fba05d79e8bce48c7267ab274176 (patch)
tree17b127703bd7fde633e26e83b0e1242487ed4949
parent2e056820e77d9b8575d3888ac20a9a0879e530c4 (diff)
downloadpango-fix-allow-breaks.tar.gz
Fix allow_breaks handlingfix-allow-breaks
handling of segmentation attributes can introduce line breaks, after we removed them in allow_breaks handling. Change the order to handle allow_breaks last, so this doesn't happen. Update affected tests.
-rw-r--r--pango/break.c6
-rw-r--r--tests/breaks/fourteen.expected2
2 files changed, 4 insertions, 4 deletions
diff --git a/pango/break.c b/pango/break.c
index 9027d6d6..05ec97c9 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -2110,9 +2110,6 @@ break_attrs (const char *text,
pango_attr_list_insert (&hyphens, pango_attribute_copy (attr));
}
- tailored |= handle_allow_breaks (text, length, &allow_breaks, offset,
- log_attrs, log_attrs_len);
-
tailored |= handle_words (text, length, &words, offset,
log_attrs, log_attrs_len);
@@ -2122,6 +2119,9 @@ break_attrs (const char *text,
tailored |= handle_hyphens (text, length, &hyphens, offset,
log_attrs, log_attrs_len);
+ tailored |= handle_allow_breaks (text, length, &allow_breaks, offset,
+ log_attrs, log_attrs_len);
+
_pango_attr_list_destroy (&allow_breaks);
_pango_attr_list_destroy (&words);
_pango_attr_list_destroy (&sentences);
diff --git a/tests/breaks/fourteen.expected b/tests/breaks/fourteen.expected
index db779ed0..1f176a6a 100644
--- a/tests/breaks/fourteen.expected
+++ b/tests/breaks/fourteen.expected
@@ -1,5 +1,5 @@
Text: ⁦a⁩ ⁦b⁩ ⁦c⁩ [ ] ⁦α⁩ ⁦β⁩ ⁦γ⁩ [0x0a]
-Breaks: c l l c lc
+Breaks: c c Lc
Whitespace: x w w
Sentences: bs e b
Words: bs bse bse be b