diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-09-30 18:07:47 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-09-30 18:09:07 +0200 |
commit | 88b671d3d879fb04fdd282f30264e6c6bfa019ee (patch) | |
tree | 3ea2c389d9ee8c3c426db607b500b1197a9f4a01 /sw/qa/extras/odfimport | |
parent | 28eec2207c763399d07fe01da8858b679d64b322 (diff) |
fdo#79269: add a unit test for first-page header too
Change-Id: I787c72cd219e16ca89a00dd9073448d8264e7bd8
Diffstat (limited to 'sw/qa/extras/odfimport')
-rw-r--r-- | sw/qa/extras/odfimport/data/fdo79269_header.odt | bin | 0 -> 8528 bytes | |||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 17 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/fdo79269_header.odt b/sw/qa/extras/odfimport/data/fdo79269_header.odt Binary files differnew file mode 100644 index 000000000000..6f1a839ecb89 --- /dev/null +++ b/sw/qa/extras/odfimport/data/fdo79269_header.odt diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 94eeb83d0031..bb6ee13f7b34 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -290,6 +290,23 @@ DECLARE_ODFIMPORT_TEST(testFdo79269, "fdo79269.odt") CPPUNIT_ASSERT_EQUAL(OUString("second"), xFooter->getString()); } +DECLARE_ODFIMPORT_TEST(testFdo79269_header, "fdo79269_header.odt") +{ + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), xCursor->getPage()); + + uno::Reference<beans::XPropertySet> xPropSet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xPropSet, "FirstIsShared")); + + uno::Reference<text::XTextRange> xFooter1 = getProperty< uno::Reference<text::XTextRange> >(xPropSet, "HeaderTextFirst"); + CPPUNIT_ASSERT_EQUAL(OUString("forst"), xFooter1->getString()); + uno::Reference<text::XTextRange> xFooter = getProperty< uno::Reference<text::XTextRange> >(xPropSet, "HeaderText"); + CPPUNIT_ASSERT_EQUAL(OUString("second"), xFooter->getString()); +} + DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt") { uno::Reference<drawing::XShape> xShape = getShape(1); |