summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2024-06-18 09:32:24 +0200
committerLászló Németh <nemeth@numbertext.org>2024-06-18 13:14:21 +0200
commit89a80d637e2831d49cdf48921f961b04fd03cffc (patch)
tree27f888bdc633e379669445182bffcf51cf93f489 /sw/source
parent8d8bc48b5efacde6f99d78a557cd052ce9e0ed07 (diff)
tdf#161628 sw DOCX: export zero hyphenation zone, if it's not defined
To keep the layout of the document, export zero hyphenation zone instead of nothing, otherwise it would be 360 twips after importing the document with the default hyphenation zone. Follow-up to commit 8d8bc48b5efacde6f99d78a557cd052ce9e0ed07 "tdf#161628 DOCX import: set default hyphenation zone (1/4 inch)". Change-Id: I7be4a001f894bcdf10fff5f1b2e211a5a45566d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169078 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/docxexport.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 622cc7b0fe6e..149c52f4d6fa 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1207,19 +1207,27 @@ void DocxExport::WriteSettings()
pColl = m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_TEXT, /*bRegardLanguage=*/false);
const SvxHyphenZoneItem* pZoneItem;
bool bHyphenationKeep = false;
+ bool bHyphenationZone = false;
if (pColl && (pZoneItem = pColl->GetItemIfSet(RES_PARATR_HYPHENZONE, false)))
{
if (pZoneItem->IsNoCapsHyphenation())
pFS->singleElementNS(XML_w, XML_doNotHyphenateCaps);
if ( sal_Int16 nHyphenZone = pZoneItem->GetTextHyphenZone() )
+ {
pFS->singleElementNS(XML_w, XML_hyphenationZone, FSNS(XML_w, XML_val),
OString::number(nHyphenZone));
+ bHyphenationZone = true;
+ }
if ( pZoneItem->IsKeep() && pZoneItem->GetKeepType() )
bHyphenationKeep = true;
}
+ // export 0, if hyphenation zone is not defined (otherwise it would be the default 360 twips)
+ if ( !bHyphenationZone )
+ pFS->singleElementNS(XML_w, XML_hyphenationZone, FSNS(XML_w, XML_val), "0");
+
// Even and Odd Headers
if( m_aSettings.evenAndOddHeaders )
pFS->singleElementNS(XML_w, XML_evenAndOddHeaders);