Kaydet (Commit) 8cf681c5 authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX import: fix FooterBodyDistance for first pages

The root cause was that code in
SectionPropertyMap::PrepareHeaderFooterProperties() saved member
variables on the stack, modified them, then restored them at the end of
the method, but forgot to restore m_nBottomMargin there.

The result of this was that First Page's FooterBodyDistance got set to
zero, which is not the same as Default Style's FooterBodyDistance (150),
so on export sw::util::IsPlausableSingleWordSection() returned false,
which turned the page break into a section break.

Change-Id: I1afa2603de1313ae1e2aaefd4b7c771fce27e21e
üst 6e580f3f
......@@ -3776,6 +3776,13 @@ DECLARE_OOXMLEXPORT_TEST(testSdtDateCharformat, "sdt-date-charformat.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:rPr/w:b", 1);
}
DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, "footer-body-distance.docx")
{
if (xmlDocPtr pXmlDoc = parseExport())
// Page break was exported as section break, this was 0
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1);
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -858,6 +858,7 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage )
// Restore original top margin, so we don't end up with a smaller margin in case we have to produce two page styles from one Word section.
m_nTopMargin = nTopMargin;
m_nHeaderTop = nHeaderTop;
m_nBottomMargin = nBottomMargin;
m_nHeaderBottom = nHeaderBottom;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment