diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 11 |
2 files changed, 17 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index fd9341c5f054..26f521b0873c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -702,9 +702,15 @@ DECLARE_OOXMLEXPORT_TEST(testFD083057, "fdo83057.docx") DECLARE_OOXMLEXPORT_TEST(testHeaderBorder, "header-border.docx") { - // This was 0, as header margin was lost during import. if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) + { + // This was 0, as header margin was lost during import. assertXPath(pXmlDoc, "//w:pgMar", "header", "720"); + // This was 33: 33 points -> 660 twips. We counted 900 - 240 (distance + // of page and body frame) instead of 720 - 240 (distance of page and + // header frame). + assertXPath(pXmlDoc, "//w:pgBorders/w:top", "space", "24"); + } } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index cacbe97beb80..4e4dccd175ba 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5499,8 +5499,17 @@ void DocxAttributeOutput::SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmF aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation(); } + // By top margin, impl_borders() means the distance between the top of the page and the header frame. + PageMargins aMargins = m_pageMargins; + HdFtDistanceGlue aGlue(pFmt->GetAttrSet()); + if (aGlue.HasHeader()) + aMargins.nPageMarginTop = aGlue.dyaHdrTop; + // Ditto for bottom margin. + if (aGlue.HasFooter()) + aMargins.nPageMarginBottom = aGlue.dyaHdrBottom; + std::map<sal_uInt16, css::table::BorderLine2> aEmptyMap; // empty styles map - impl_borders( m_pSerializer, rBox, aOutputBorderOptions, &m_pageMargins, + impl_borders( m_pSerializer, rBox, aOutputBorderOptions, &aMargins, aEmptyMap ); m_pSerializer->endElementNS( XML_w, XML_pgBorders ); |