summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-01-14 20:22:37 -0500
committerMatthias Clasen <mclasen@redhat.com>2022-01-24 07:46:42 -0500
commit6d5b02deda94c46b617b8211518f80c54f2c01c4 (patch)
treee4730a63085b63b78231ac814d6895e9bfdd4d9a
parent3ffef56f2d2d5bb1cca95f91f0851d3a51ee0033 (diff)
downloadpango-6d5b02deda94c46b617b8211518f80c54f2c01c4.tar.gz
break: Cosmetics
Just rearrange the hyphen code slightly.
-rw-r--r--pango/break.c19
1 files 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;
}