summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfexport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-10-09 18:33:22 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-10-09 18:49:38 +0200
commitb5bb36194bc25ccbef027dec257092bbf395386d (patch)
tree401d10b0d020973cf95cd56370d11decdb50a882 /sw/qa/extras/odfexport
parent59ab112fe93cbf4e2b052f4e8bafbdb4e6738bef (diff)
sw: add odf and ww8 regression tests for first page header/footer
Change-Id: Ic002f3cba79b6758475cf9d3153ae3063eb640a3
Diffstat (limited to 'sw/qa/extras/odfexport')
-rw-r--r--sw/qa/extras/odfexport/data/first-header-footer.odtbin0 -> 9644 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx22
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/first-header-footer.odt b/sw/qa/extras/odfexport/data/first-header-footer.odt
new file mode 100644
index 000000000000..2ed6b740a102
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/first-header-footer.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 1a30dd5fddba..032da03cd640 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -33,10 +33,12 @@ class Test : public SwModelTestBase
{
public:
void testFdo38244();
+ void testFirstHeaderFooter();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
CPPUNIT_TEST(testFdo38244);
+ CPPUNIT_TEST(testFirstHeaderFooter);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -86,6 +88,26 @@ void Test::testFdo38244()
CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty<OUString>(xPropertySet, "Initials"));
}
+void Test::testFirstHeaderFooter()
+{
+ // Test import and export of the header-first token.
+ roundtrip("first-header-footer.odt");
+
+ // The document has 6 pages, two page styles for the first and second half of pages.
+ CPPUNIT_ASSERT_EQUAL(OUString("First header"), parseDump("/root/page[1]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First footer"), parseDump("/root/page[1]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Left header"), parseDump("/root/page[2]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Left footer"), parseDump("/root/page[2]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Right header"), parseDump("/root/page[3]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Right footer"), parseDump("/root/page[3]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First header2"), parseDump("/root/page[4]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("First footer2"), parseDump("/root/page[4]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Right header2"), parseDump("/root/page[5]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Right footer2"), parseDump("/root/page[5]/footer/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Left header2"), parseDump("/root/page[6]/header/txt/text()"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Left footer2"), parseDump("/root/page[6]/footer/txt/text()"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();