diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/footer-margin-lost.docx | bin | 0 -> 21058 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 11 |
3 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/footer-margin-lost.docx b/sw/qa/extras/ooxmlexport/data/footer-margin-lost.docx Binary files differnew file mode 100644 index 000000000000..d6a9d7bd8df9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/footer-margin-lost.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx index e12804e58289..c2d17d965781 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx @@ -38,6 +38,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, "tdf138892_noNumbering.docx" CPPUNIT_ASSERT_MESSAGE("Para3: <blank line>", getProperty<OUString>(getParagraph(3), "NumberingStyleName").isEmpty()); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFooterMarginLost, "footer-margin-lost.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport(); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 709 + // - Actual : 0 + // i.e. import + export lost the footer margin value. + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:pgMar", "footer", "709"); +} + DECLARE_OOXMLEXPORT_TEST(testTdf138953, "croppedAndRotated.odt") { CPPUNIT_ASSERT_EQUAL(1, getShapes()); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index cc63cb5160ea..4f8773bef97b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -8547,6 +8547,17 @@ void DocxAttributeOutput::FormatULSpace( const SvxULSpaceItem& rULSpace ) sal_Int32 nFooter = 0; if ( aDistances.HasFooter() ) nFooter = sal_Int32( aDistances.dyaHdrBottom ); + else if (m_rExport.m_pFirstPageFormat) + { + HdFtDistanceGlue aFirstPageDistances(m_rExport.m_pFirstPageFormat->GetAttrSet()); + if (aFirstPageDistances.HasFooter()) + { + // The follow page style has no footer, but the first page style has. In Word terms, + // this means that the footer margin of "the" section is coming from the first page + // style. + nFooter = sal_Int32(aFirstPageDistances.dyaHdrBottom); + } + } // Page Bottom m_pageMargins.nBottom = aDistances.dyaBottom; |