summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2025-02-17 19:20:04 +0100
committerLászló Németh <nemeth@numbertext.org>2025-02-21 08:52:21 +0100
commit3e02ffb76c484a05cdc140d8a10bc3d993fe8320 (patch)
treeed3c56c86b63131c37f46c8548388abe8c00a181 /svx
parent2aaa35d2a2281b87b8803bab990592099100350f (diff)
tdf#i165354 sw offapi DOCX: implement HyphenationKeepLine – part 1
ODF 1.0 feature hyphenation-keep, i.e. disabling hyphenation across page etc. was implemented by shifting the full hyphenated line (fixing also the DOCX layout interoperability, when value of the useWord2013TrackBottomHyphenation MSO DOCX compatibility option is true). To shift only the last word, add UNO paragraph property com::sun::star::text::ParagraphHyphenationKeepLine and the associated layout in Writer core, i.e. disabling the hyphenation in the last line, instead of line shifting, if the value of ParagraphHyphenationKeepLine is true. Fix missing DOCX layout interoperability by mapping the unhandled useWord2013TrackBottomHyphenation = false case to the new layout. Note: shifting lines may be better for languages with long words, but only with 1) typesetting with line-level (greedy) line breaking instead of the desirable paragraph-level, 2) and with missing optimized hyphenation at boundaries of compound word constituents, and 3) forgotting the following: Shifting only words or word constituents are better for 1) equal line count on pages and spreads (very basic typographical requirement), 2) disabling hyphenation really (shifting doesn't guarantee this, because shifting is limited in a single line, but the previous line can be hyphenated, too) and 3) more compact typesetting. Both hyphenation-keep algorithms are important for interoperability, but the new HyphenationKeepLine can create state-of-the-art automatic typesetting with the planned improvements. Follow-up to commit 9574a62add8e4901405e12117e75c86c2d2c2f21 "tdf#132599 cui offapi sw xmloff: implement hyphenate-keep". and commit c8ee0e8f581b8a6e41b1a6b8aa4d40b442c1d463 "tdf160518 DOCX: import hyphenation-keep to fix layout". Change-Id: Iafa352ec91bbd5d1d227b8480337fa2b9acb5993 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181954 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r--svx/sdi/svxitems.sdi1
1 files changed, 1 insertions, 0 deletions
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index 0f3da887b64c..0415b6955dd9 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -277,6 +277,7 @@ struct SvxHyphenZone
INT16 HyphenZone MID_HYPHEN_ZONE;
BOOL HyphenKeep MID_HYPHEN_KEEP;
INT16 HyphenKeepType MID_HYPHEN_KEEP_TYPE;
+ BOOL HyphenKeepLine MID_HYPHEN_KEEP_LINE;
INT16 MinLead MID_HYPHEN_COMPOUND_MIN_LEAD;
};
item SvxHyphenZone SvxHyphenZoneItem;