summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2024-03-18 21:55:23 +0100
committerLászló Németh <nemeth@numbertext.org>2024-03-20 13:04:09 +0100
commit3a332d9f1cacb3c6f81fcf6c08afa51d091ddff4 (patch)
tree69e2b79224aeea2e74bee4922f1e6cc254dd64c9 /sw/inc
parente68a15941926965575cedcacbe0d301111388bef (diff)
tdf#158885 cui offapi sw xmloff: fix hyphenation at stem boundary
Add new hyphenation option "Compound characters at line end", equivalent of libhyphen's COMPOUNDLEFTHYPHENMIN, to limit bad pattern based hyphenation of compound words using morphological analysis of Hunspell. * Add checkbox to Text Flow in paragraph formatting dialog window * Store property in paragraph model: css::style::ParagraphProperties::ParaHyphenationCompoundMinLeadingChars * Add ODF import/export (loext:hyphenation-compound-remain-char-count) * Add ODF unit tests Note: slower Hunspell based hyphenation is used only if ParaHyphenationCompoundMinLeadingChars >= 3 (we assume that libhyphen hyphenation patterns cover the smaller distances correctly). Hunpell based hyphenation doesn't introduce new hyphenation breaks, only detects the stem boundaries from the libhyphen based hyphenation breaks. Follow-up to commit c899d3608d30f3ab4c2bc193c1fcd765221614a4 "tdf#158885 sw: don't hyphenate right after a stem boundary", replacing hyphenation zone dependence with the new "Compound characters at line end". Note: preset COMPOUNDLEFTHYPHENMIN values aren't loaded yet from hyphenation dictionaries. Note: the suffix of the last stem of the compound is always hyphenated, i.e. the distance limits only hyphenation inside the stem, not inside its suffix or at the end of the stem before the suffix. Change-Id: I46a0288929a66f7453e3ff97fbc5a0c6a01f038f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164983 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/inspectorproperties.hrc5
-rw-r--r--sw/inc/unoprnms.hxx2
2 files changed, 5 insertions, 2 deletions
diff --git a/sw/inc/inspectorproperties.hrc b/sw/inc/inspectorproperties.hrc
index bc9686b0aa91..2b8379bbf0ae 100644
--- a/sw/inc/inspectorproperties.hrc
+++ b/sw/inc/inspectorproperties.hrc
@@ -203,8 +203,9 @@
#define RID_PARA_FIRST_LINE_INDENT NC_("RID_ATTRIBUTE_NAMES_MAP", "Para First Line Indent")
#define RID_PARA_FIRST_LINE_INDENT_RELATIVE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para First Line Indent Relative")
#define RID_PARA_HYPHENATION_MAX_HYPHENS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Max Hyphens")
-#define RID_PARA_HYPHENATION_MAX_LEADING_CHARS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Max Leading Chars")
-#define RID_PARA_HYPHENATION_MAX_TRAILING_CHARS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Max Trailing Chars")
+#define RID_PARA_HYPHENATION_MAX_LEADING_CHARS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Min Leading Chars")
+#define RID_PARA_HYPHENATION_MAX_TRAILING_CHARS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Min Trailing Chars")
+#define RID_PARA_HYPHENATION_COMPOUND_MIN_LEADING_CHARS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Compound Min Leading Chars")
#define RID_PARA_HYPHENATION_NO_CAPS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation No Caps")
#define RID_PARA_HYPHENATION_NO_LAST_WORD NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation No Last Word")
#define RID_PARA_HYPHENATION_MIN_WORD_LENGTH NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Min Word Length")
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index b97e2a81dc5e..2f2df94b563e 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -69,6 +69,8 @@ inline constexpr OUString UNO_NAME_PARA_HYPHENATION_MAX_LEADING_CHARS
= u"ParaHyphenationMaxLeadingChars"_ustr;
inline constexpr OUString UNO_NAME_PARA_HYPHENATION_MAX_TRAILING_CHARS
= u"ParaHyphenationMaxTrailingChars"_ustr;
+inline constexpr OUString UNO_NAME_PARA_HYPHENATION_COMPOUND_MIN_LEADING_CHARS
+ = u"ParaHyphenationCompoundMinLeadingChars"_ustr;
inline constexpr OUString UNO_NAME_PARA_HYPHENATION_MAX_HYPHENS = u"ParaHyphenationMaxHyphens"_ustr;
inline constexpr OUString UNO_NAME_PARA_HYPHENATION_MIN_WORD_LENGTH
= u"ParaHyphenationMinWordLength"_ustr;