From 6d5b02deda94c46b617b8211518f80c54f2c01c4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 14 Jan 2022 20:22:37 -0500 Subject: 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; } -- cgit v1.2.1