summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2024-01-18 14:53:24 +0100
committerLászló Németh <nemeth@numbertext.org>2024-01-19 00:42:36 +0100
commit73bd04a71e741788a2f2f3b26cc46ddb6a361372 (patch)
treefce26542357e58c47aea1b0fa67d38203333140f /xmloff
parentd4076bb145590bb10e5cd7e47628169bb9e6c446 (diff)
tdf#106733 xmloff: keep fo:hyphenate in character formatting
In the case of character formatting, map fo:hyphenate to the unused CharNoHyphenation character property to keep it during ODF import/export instead of losing it completely. This is the first step to disable hyphenation for single words or text spans in paragraphs with automatic hyphenation. Note: using fo:hyphenate as character property is part of the ODF standard. Note: the old workaround to disable hyphenation, changing the language of the text to None had got some serious fallbacks: losing spell checking and losing language-dependent text layout (supported by both OpenType and Graphite font engines in LibreOffice). Change-Id: I9565c3efbbb6e6d970fb03710e8c932ad72ab57e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162257 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmlprop.hxx1
-rw-r--r--xmloff/source/text/txtprmap.cxx4
2 files changed, 3 insertions, 2 deletions
diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx
index d93e0b89fbf5..89c53b72a8ea 100644
--- a/xmloff/inc/xmlprop.hxx
+++ b/xmloff/inc/xmlprop.hxx
@@ -94,6 +94,7 @@ inline constexpr OUString PROP_CharLeftBorderDistance = u"CharLeftBorderDistance
inline constexpr OUString PROP_CharLocale = u"CharLocale"_ustr;
inline constexpr OUString PROP_CharLocaleAsian = u"CharLocaleAsian"_ustr;
inline constexpr OUString PROP_CharLocaleComplex = u"CharLocaleComplex"_ustr;
+inline constexpr OUString PROP_CharNoHyphenation = u"CharNoHyphenation"_ustr;
inline constexpr OUString PROP_CharOverline = u"CharOverline"_ustr;
inline constexpr OUString PROP_CharOverlineColor = u"CharOverlineColor"_ustr;
inline constexpr OUString PROP_CharOverlineHasColor = u"CharOverlineHasColor"_ustr;
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index cf6adc9a1927..faa8150a3b6a 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -194,7 +194,7 @@ XMLPropertyMapEntry constexpr aXMLParaPropMap[] =
// RES_CHRATR_BLINK
MT_E( PROP_CharFlash, XML_NAMESPACE_STYLE, XML_TEXT_BLINKING, XML_TYPE_BOOL, 0 ),
// RES_CHRATR_NOHYPHEN
- // TODO: not used?
+ // TODO: only for words, PROP_ParaIsHyphenation is for paragraphs: check them
// RES_CHRATR_UNUSED2
// RES_CHRATR_BACKGROUND
MT_E( PROP_CharBackColor, XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, CTF_CHAR_BACKGROUND ),
@@ -546,7 +546,7 @@ XMLPropertyMapEntry constexpr aXMLTextPropMap[] =
// RES_CHRATR_BLINK
MT_E( PROP_CharFlash, XML_NAMESPACE_STYLE, XML_TEXT_BLINKING, XML_TYPE_BOOL, 0 ),
// RES_CHRATR_NOHYPHEN
- // TODO: not used?
+ MT_E( PROP_CharNoHyphenation, XML_NAMESPACE_FO, XML_HYPHENATE, XML_TYPE_BOOL, 0 ),
// RES_CHRATR_UNUSED2
// RES_CHRATR_BACKGROUND
MT_E( PROP_CharBackColor, XML_NAMESPACE_FO, XML_BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, CTF_CHAR_BACKGROUND ),