diff options
author | Luke Deller <luke@deller.id.au> | 2014-07-12 21:49:50 +1000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-11 15:59:01 +0200 |
commit | 79bd799f0571a7213faa9b81709d0b4084a21c57 (patch) | |
tree | 757d2a72a465372eed9fd7cb97f17e4781d91a03 /sw | |
parent | 416546ee8ef21d8ea33c1aa2c17dd6a9a0ac6189 (diff) |
Related: fdo#82114 Copy first-header-footer test from ww8 to ooxml
The test document was converted from doc to docx using MS Word 2010.
Several fixes were required to make this test pass:
- Do not clear the "FirstIsShared" property on page styles, as the code
instead uses the old fashioned method of translating a Word section
with "different first page header/footer": two page styles linked
together, the first page style and the follow page style.
(Also remove a wrong test case which checks the FirstIsShared property)
- Do not clear the "HeaderIsShared"/"FooterIsShared" properties on the
first page style, only on the follow page style.
- Actually set the "FollowStyle" property on the first page style to
link it to the follow page style. This didn't matter for the very
first Word section because it was mapped to the default page styles
"First Page" and "Standard" which are already linked, but it does
matter for subsequent Word sections.
- For some reason setting a new page style at a section break was
excluded in the case where the following section had a title page.
Remove this exclusion.
- The exclusion mentioned in the last point was masking that bnc#751077
was not entirely fixed. To resolve that issue:
When checking if the last paragraph of the section is empty, consider
not just text content but also shapes.
- Remove a workaround for bnc#780843 involving copying of headers and
footers from the "Standard" (first section) page style in the case
where the following section had a title page. This workaround is no
longer needed as the test case passes without it.
(cherry picked from commit b4ccde72b8e2e45e7276d5b08b182495a1b1a617)
Change-Id: Iacc9bba0720c11414da3e852892cff301ebbc4fe
Diffstat (limited to 'sw')
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/first-header-footer.docx | bin | 0 -> 21998 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/first-header-footer.docx b/sw/qa/extras/ooxmlexport/data/first-header-footer.docx Binary files differnew file mode 100755 index 000000000000..d18eea5866b5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/first-header-footer.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index fb00ef3974c0..ffb083294499 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -959,8 +959,14 @@ DECLARE_OOXMLEXPORT_TEST(testPageBorderSpacingExportCase2, "page-borders-export- DECLARE_OOXMLEXPORT_TEST(testFdo66145, "fdo66145.docx") { // The Writer ignored the 'First Is Shared' flag - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("First Page"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(xPropertySet, "FirstIsShared"))); + CPPUNIT_ASSERT_EQUAL(OUString("This is the FIRST page header."), + parseDump("/root/page[1]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL( + OUString("This is the header for the REST OF THE FILE."), + parseDump("/root/page[2]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL( + OUString("This is the header for the REST OF THE FILE."), + parseDump("/root/page[3]/header/txt/text()")); } DECLARE_OOXMLEXPORT_TEST(testGrabBag, "grabbag.docx") |