summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2025-03-01 16:24:04 +0100
committerLászló Németh <nemeth@numbertext.org>2025-03-03 14:27:40 +0100
commitf8b9cd8fd13897094a014ad06df406f0c78adc62 (patch)
treeaa515b433d832ff9c6223a03d4679032f19a5bf9 /xmloff/source
parent7668d76e7a7d10a94c6122d7ff7932ab4cb1710a (diff)
tdf#165354 sw xmloff: implement HyphenationKeepLine – part 2
Add loext:hyphenation-keep-line to the ODF export/import to support HyphenationKeepLine, i.e. MS DOCX compatibility option useWord2013TrackBottomHyphenation=false, where not the full hyphenated line, but only the hyphenated word is shifted to the next text block. Add unit tests for hyphenation-keep-type="page" and "spread" with hyphenation-keep-line="true" support. Follow-up to commit 3e02ffb76c484a05cdc140d8a10bc3d993fe8320 "tdf#i165354 sw offapi DOCX: implement HyphenationKeepLine – part 1". Fix unit test testTdf132599_spread, which loaded tdf132599_page.fodt instead of tdf132599_spread.fodt (duplicating testTdf132599_page). Restore unit test testTdf160518_auto_in_text_body_style, which was removed by accident in commit 3e02ffb76c484a05cdc140d8a10bc3d993fe8320. Silence the linguistic warning of HyphKeepLine, according to the commit d25de4a04671c2f380fc86a58259b073c49dfe19 "silence unknown property 'HyphNoLastWord'... etc warnings". Change-Id: Ibb9643f8e20ee2a1456c4d62b901e4c66b57c341 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182424 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: Jenkins
Diffstat (limited to 'xmloff/source')
-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 9c6ba7833a75..b0fc6e028c2f 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -1073,6 +1073,7 @@ namespace xmloff::token {
TOKEN( "hyperlink-behaviour", XML_HYPERLINK_BEHAVIOUR ),
TOKEN( "hyphenate", XML_HYPHENATE ),
TOKEN( "hyphenation-keep", XML_HYPHENATION_KEEP ),
+ TOKEN( "hyphenation-keep-line", XML_HYPHENATION_KEEP_LINE ),
TOKEN( "hyphenation-keep-type", XML_HYPHENATION_KEEP_TYPE ),
TOKEN( "hyphenation-ladder-count", XML_HYPHENATION_LADDER_COUNT ),
TOKEN( "hyphenation-push-char-count", XML_HYPHENATION_PUSH_CHAR_COUNT ),
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index 0d4435025f46..90365304e06a 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -348,6 +348,7 @@ XMLPropertyMapEntry constexpr aXMLParaPropMap[] =
MAP_EXT( PROP_ParaHyphenationCompoundMinLeadingChars, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_COMPOUND_REMAIN_CHAR_COUNT, XML_TYPE_NUMBER16_NO_ZERO|XML_TYPE_PROP_TEXT, 0 ),
MP_E( PROP_ParaHyphenationKeep, XML_NAMESPACE_FO, XML_HYPHENATION_KEEP, XML_TYPE_HYPHENATION_KEEP, 0 ),
MAP_EXT( PROP_ParaHyphenationKeepType, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_KEEP_TYPE, XML_TYPE_HYPHENATION_KEEP_TYPE|XML_TYPE_PROP_PARAGRAPH, 0 ),
+ MAP_EXT( PROP_ParaHyphenationKeepLine, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_KEEP_LINE, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0 ),
// RES_PARATR_DROP
MP_E( PROP_DropCapWholeWord, XML_NAMESPACE_STYLE, XML_LENGTH, MID_FLAG_SPECIAL_ITEM|XML_TYPE_BOOL, CTF_DROPCAPWHOLEWORD ),
MP_E( PROP_DropCapCharStyleName, XML_NAMESPACE_STYLE, XML_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 8752dd63723d..004243725964 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -973,6 +973,7 @@ hyperlink
hyperlink-behaviour
hyphenate
hyphenation-keep
+hyphenation-keep-line
hyphenation-keep-type
hyphenation-ladder-count
hyphenation-push-char-count