[pango/fix-allow-breaks] Fix allow_breaks handling




commit dd8e718e1997fba05d79e8bce48c7267ab274176
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jan 20 22:06:32 2022 -0500

    Fix allow_breaks handling
    
    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.

 pango/break.c                  | 6 +++---
 tests/breaks/fourteen.expected | 2 +-
 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 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]