diff options
Diffstat (limited to 'sw/qa/extras/ww8export/ww8export.cxx')
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index b38c1f0c771c..470028cd9635 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -41,12 +41,14 @@ public: void testN325936(); void testFdo45724(); void testFdo46020(); + void testFirstHeaderFooter(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) CPPUNIT_TEST(testN325936); CPPUNIT_TEST(testFdo45724); CPPUNIT_TEST(testFdo46020); + CPPUNIT_TEST(testFirstHeaderFooter); #endif CPPUNIT_TEST_SUITE_END(); @@ -104,6 +106,27 @@ void Test::testFdo46020() CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xFootnotes->getCount()); } +void Test::testFirstHeaderFooter() +{ + // Test import and export of a section's headerf/footerf properties. + roundtrip("first-header-footer.doc"); + + // The document has 6 pages. Note that we don't test if 4 or just 2 page + // styles are created, the point is that layout should be correct. + CPPUNIT_ASSERT_EQUAL(OUString("First page header"), parseDump("/root/page[1]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("First page footer"), parseDump("/root/page[1]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page header"), parseDump("/root/page[2]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page footer"), parseDump("/root/page[2]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page header"), parseDump("/root/page[3]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer"), parseDump("/root/page[3]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("First page header2"), parseDump("/root/page[4]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("First page footer 2"), parseDump("/root/page[4]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page header 2"), parseDump("/root/page[5]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Odd page footer 2"), parseDump("/root/page[5]/footer/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page header 2"), parseDump("/root/page[6]/header/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"), parseDump("/root/page[6]/footer/txt/text()")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |