diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-02-07 16:06:19 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-02-07 20:57:55 +0100 |
commit | f0decd9c932b50eddeecd49a6ee44182e78be938 (patch) | |
tree | 312e5f7731baf1c8bd73426ad8985327c7c8dbff /sw/qa | |
parent | 75bd1ba4cd4eea179092f3c8fd7aa6b903b17993 (diff) |
DOCX export: fix handling of section starts that originally had page margins
This is similar to commit 26f2a9e1a10a22e864e71ee7c94934821703e021 (DOCX
export: fix handling of section starts that originally had headers,
2020-02-06), except here the top margin has to taken from that follow
page style, not the header.
Without this, it can happen that the page number in the original Writer
doc model and the exported Word result do not match.
This required reworking WriteNextStyleHeaderFooter(), which assumed that
the header/footer status is already calculated by the time its called.
But the page margin code runs earlier, so we need to make that decision
earlier, even when the header/footer status is not yet calculated.
Change-Id: Ife7396603702d2048d544aa46f96acfa337a041a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88211
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 7817c26ad5ac..3bdae52c4d65 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -485,6 +485,18 @@ DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header- // - Expected: Header, section 2 // - Actual : First page header, section 2 // i.e. both the header and the footer on page 3 was wrong. + + // Additional problem: top margin on page 3 was wrong. + if (mbExported) + { + xmlDocPtr pXml = parseExport("word/document.xml"); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 2200 + // - Actual : 2574 + // i.e. the top margin on page 3 was too large and now matches the value from the input + // document. + assertXPath(pXml, "/w:document/w:body/w:sectPr/w:pgMar", "top", "2200"); + } } CPPUNIT_PLUGIN_IMPLEMENT(); |