summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfimport/odfimport.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-09-30 18:07:47 +0200
committerMichael Stahl <mstahl@redhat.com>2014-09-30 18:09:07 +0200
commit88b671d3d879fb04fdd282f30264e6c6bfa019ee (patch)
tree3ea2c389d9ee8c3c426db607b500b1197a9f4a01 /sw/qa/extras/odfimport/odfimport.cxx
parent28eec2207c763399d07fe01da8858b679d64b322 (diff)
fdo#79269: add a unit test for first-page header too
Change-Id: I787c72cd219e16ca89a00dd9073448d8264e7bd8
Diffstat (limited to 'sw/qa/extras/odfimport/odfimport.cxx')
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx17
1 files changed, 17 insertions, 0 deletions
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);