summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/gutter-top.docxbin0 -> 13032 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx11
-rw-r--r--sw/source/filter/ww8/docxexport.cxx5
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/gutter-top.docx b/sw/qa/extras/ooxmlexport/data/gutter-top.docx
new file mode 100644
index 000000000000..d48cb2846287
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/gutter-top.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 52cfc5c11387..6859ac0d1c6b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -170,6 +170,17 @@ DECLARE_OOXMLEXPORT_TEST(testGutterLeft, "gutter-left.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testGutterTop, "gutter-top.docx")
+{
+ xmlDocPtr pXmlSettings = parseExport("word/settings.xml");
+ CPPUNIT_ASSERT(pXmlSettings);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1
+ // - Actual : 0
+ // i.e. <w:gutterAtTop> was lost.
+ assertXPath(pXmlSettings, "/w:settings/w:gutterAtTop", 1);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index a46b3eb779a2..74745f68f604 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1021,6 +1021,11 @@ void DocxExport::WriteSettings()
if(isMirroredMargin())
pFS->singleElementNS(XML_w, XML_mirrorMargins);
+ if (m_pDoc->getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP))
+ {
+ pFS->singleElementNS(XML_w, XML_gutterAtTop);
+ }
+
// Embed Fonts
if( m_pDoc->getIDocumentSettingAccess().get( DocumentSettingId::EMBED_FONTS ))
pFS->singleElementNS(XML_w, XML_embedTrueTypeFonts);