[Libreoffice-commits] core.git: sw/qa

Michael Stahl mstahl at redhat.com
Tue Sep 30 09:13:53 PDT 2014


 sw/qa/extras/odfimport/data/fdo79269_header.odt |binary
 sw/qa/extras/odfimport/odfimport.cxx            |   17 +++++++++++++++++
 2 files changed, 17 insertions(+)

New commits:
commit 88b671d3d879fb04fdd282f30264e6c6bfa019ee
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Sep 30 18:07:47 2014 +0200

    fdo#79269: add a unit test for first-page header too
    
    Change-Id: I787c72cd219e16ca89a00dd9073448d8264e7bd8

diff --git a/sw/qa/extras/odfimport/data/fdo79269_header.odt b/sw/qa/extras/odfimport/data/fdo79269_header.odt
new file mode 100644
index 0000000..6f1a839
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo79269_header.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 94eeb83..bb6ee13 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);


More information about the Libreoffice-commits mailing list