diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-02-05 10:03:04 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-02-10 12:11:09 +0100 |
commit | 6fa5ce6cb9d121329bf1056c471bf522fc50d3fc (patch) | |
tree | 200ba4aa80b8685243a992f7ddc7e53a7f120bd4 /sw | |
parent | bd4b1697496daa39d8ecfe034d707a89902dc07e (diff) |
tdf#91920 sw page gutter margin, from top: add DOCX filter
ODF filter was already working as-is.
(cherry picked from commit 506bacb79ab96656de9168d0db3e3159c6bde3b0)
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
writerfilter/source/dmapper/SettingsTable.cxx
writerfilter/source/dmapper/SettingsTable.hxx
Change-Id: I71089a5d0171eba0cd4c2d14bdee6ca9b64193b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110668
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/gutter-top.docx | bin | 0 -> 13032 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 5 |
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 Binary files differnew file mode 100644 index 000000000000..d48cb2846287 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/gutter-top.docx 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); |