diff --git a/sw/qa/extras/ooxmlexport/data/tdf132599_frames_on_right_pages_no_hyphenation.fodt b/sw/qa/extras/ooxmlexport/data/tdf132599_frames_on_right_pages_no_hyphenation.fodt
new file mode 100644
index 000000000000..c3df7b605f3a
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf132599_frames_on_right_pages_no_hyphenation.fodt
@@ -0,0 +1,224 @@
+
+
+
+
+
+ false
+ true
+ true
+
+ false
+ 0
+ false
+ true
+ true
+ false
+ false
+ 0
+ true
+ false
+ false
+ false
+ false
+ false
+ true
+ false
+ false
+ true
+ false
+ true
+ true
+ false
+ true
+ false
+ false
+ false
+ false
+ true
+ true
+ false
+ false
+ false
+ false
+ false
+ false
+ high-resolution
+ false
+ 595440
+ false
+ true
+ false
+
+
+ true
+
+ false
+ false
+ false
+ true
+ true
+ true
+ false
+ 0
+ true
+ false
+ false
+ true
+ true
+ true
+ false
+ true
+ false
+ false
+ false
+ false
+ false
+ true
+ true
+ false
+
+ true
+ false
+ false
+ 0
+ false
+ true
+
+ false
+ false
+ true
+ true
+ false
+ false
+ true
+ 1
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ true
+ false
+ false
+ false
+ true
+ false
+
+ true
+ 1131034
+ true
+ false
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Space. It merely moves along in space inertially. Even just one inch above the surface of the Earth is space, except that it has an atmosphere. Earth is. The Earth is no different to any other celestial body
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index d0e84df71295..47ac22113db4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -794,6 +794,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf149421_default, "tdf146171.docx")
CPPUNIT_ASSERT_EQUAL( static_cast(360), getProperty(xStyle, u"ParaHyphenationZone"_ustr));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf161628, "tdf132599_frames_on_right_pages_no_hyphenation.fodt")
+{
+ uno::Reference xStyle(getStyles(u"ParagraphStyles"_ustr)->getByName(u"Standard"_ustr), uno::UNO_QUERY);
+ // This was 360 after the second import (missing export of zero hyphenation zone)
+ CPPUNIT_ASSERT_EQUAL( static_cast(0), getProperty(xStyle, u"ParaHyphenationZone"_ustr));
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf121658)
{
loadAndSave("tdf121658.docx");
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);