summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-05-26 19:01:07 +0200
committerLászló Németh <nemeth@numbertext.org>2022-05-26 20:25:35 +0200
commit29359fc15c435cec17987fd6221ab6833d38746e (patch)
treec4bc33e84fee7414c0e0d5e9e6b9c77526e2aa68 /xmloff
parent3cde7345199b535763bb7d83a87096e9157b7317 (diff)
tdf#149324 sw offapi xmloff: add option to not hyphenate short words
Add paragraph property to disable automatic hyphenation of short words based on a minimum character count. Note: there is a (broken) global option for Minimum Word Length at hyphenation, see "Minimal number of characters for hyphenation" in Tools->Options->Language Settings->Writing Aids), but for better/comfortable paragraph-level adjustment of typesetting, add a paragraph property for it. The same option is available e.g. in Adobe InDesign and in CSS Text Module Level 4 (hyphenate-limit-chars). * Add checkbox to Text Flow in paragraph dialog * Store property in paragraph model (com::sun::star::style::ParagraphProperties::ParaHyphenationMinWordLength) * Add ODF import/export * Add ODF unit test * Add layout test Follow-up to commit 8c018910ae4d8701b1ce2a95727b9baed4016da3 "tdf#149248 sw offapi xmloff: add option to not hyphenate last word". Change-Id: I68715f47d17b5c022430bd0e74c88a97bc7f81f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135028 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmltoken.cxx1
-rw-r--r--xmloff/source/text/txtprmap.cxx1
-rw-r--r--xmloff/source/token/tokens.txt1
3 files changed, 3 insertions, 0 deletions
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 34371453c815..356b98051ec0 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -1065,6 +1065,7 @@ namespace xmloff::token {
TOKEN( "hyphenation-remain-char-count", XML_HYPHENATION_REMAIN_CHAR_COUNT ),
TOKEN( "hyphenation-no-caps", XML_HYPHENATION_NO_CAPS ),
TOKEN( "hyphenation-no-last-word", XML_HYPHENATION_NO_LAST_WORD ),
+ TOKEN( "hyphenation-word-char-count", XML_HYPHENATION_WORD_CHAR_COUNT ),
TOKEN( "i", XML_I ),
TOKEN( "icon", XML_ICON ),
TOKEN( "icon-set", XML_ICON_SET ),
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index b116b16c836e..a2e110e5bdb0 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -344,6 +344,7 @@ XMLPropertyMapEntry const aXMLParaPropMap[] =
MP_E( "ParaHyphenationMaxHyphens", FO, HYPHENATION_LADDER_COUNT, XML_TYPE_NUMBER16_NONE, 0 ),
MAP_EXT( "ParaHyphenationNoCaps", XML_NAMESPACE_LO_EXT, XML_HYPHENATION_NO_CAPS, XML_TYPE_BOOL|XML_TYPE_PROP_TEXT, 0 ),
MAP_EXT( "ParaHyphenationNoLastWord", XML_NAMESPACE_LO_EXT, XML_HYPHENATION_NO_LAST_WORD, XML_TYPE_BOOL|XML_TYPE_PROP_TEXT, 0 ),
+ MAP_EXT( "ParaHyphenationMinWordLength", XML_NAMESPACE_LO_EXT, XML_HYPHENATION_WORD_CHAR_COUNT, XML_TYPE_NUMBER16_NONE|XML_TYPE_PROP_TEXT, 0 ),
// RES_PARATR_DROP
MP_E( "DropCapWholeWord", STYLE, LENGTH, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_DROPCAPWHOLEWORD ),
MP_E( "DropCapCharStyleName", STYLE, STYLE_NAME, MID_FLAG_SPECIAL_ITEM|XML_TYPE_STRING, CTF_DROPCAPCHARSTYLE ),
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index cc365e61d3a0..ee0adc36055d 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -965,6 +965,7 @@ hyphenation-push-char-count
hyphenation-remain-char-count
hyphenation-no-caps
hyphenation-no-last-word
+hyphenation-word-char-count
i
icon
icon-set