[pango/line-breaker: 7/41] break: Cosmetics




commit 44c079f975b115a82b79cc214eef3b0cfcbdc8e9
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 14 20:22:37 2022 -0500

    break: Cosmetics
    
    Just rearrange the hyphen code slightly.

 pango/break.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)
---
diff --git a/pango/break.c b/pango/break.c
index 05ec97c9..8ebeb69c 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -1601,11 +1601,6 @@ default_break (const char    *text,
               space_or_hyphen = TRUE;
             break;
           default:
-            break;
-          }
-
-        if (!space_or_hyphen)
-          {
             if (wc == '-'    || /* Hyphen-minus */
                 wc == 0x058a || /* Armenian hyphen */
                 wc == 0x1400 || /* Canadian syllabics hyphen */
@@ -1617,9 +1612,15 @@ default_break (const char    *text,
                 wc == 0xfe63 || /* Small hyphen-minus */
                 wc == 0xff0d)   /* Fullwidth hyphen-minus */
               space_or_hyphen = TRUE;
+            break;
           }
 
-        if (attrs[i].is_word_boundary)
+        if (prev_wc == 0x2027)     /* Hyphenation point */
+          {
+            attrs[i].break_inserts_hyphen = TRUE;
+            attrs[i].break_removes_preceding = TRUE;
+          }
+        else if (attrs[i].is_word_boundary)
           attrs[i].break_inserts_hyphen = FALSE;
         else if (prev_space_or_hyphen)
           attrs[i].break_inserts_hyphen = FALSE;
@@ -1628,12 +1629,6 @@ default_break (const char    *text,
         else
           attrs[i].break_inserts_hyphen = insert_hyphens;
 
-        if (prev_wc == 0x2027)     /* Hyphenation point */
-          {
-            attrs[i].break_inserts_hyphen = TRUE;
-            attrs[i].break_removes_preceding = TRUE;
-          }
-
         prev_space_or_hyphen = space_or_hyphen;
       }
 


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