diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-09-29 23:22:12 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-09-29 23:59:29 +0200 |
commit | 0f21f932081471b2a5eda820fa1a194fbf3ab85c (patch) | |
tree | 6c84c713a42a25eb3d7b24cbebf756f3347ca32a /sw/qa/extras | |
parent | 87331efa9b190793c1719b31a62a2eef6a66f92d (diff) |
fdo#79269: fix ODF import of style:footer-first
The implementation of SwXStyle's FirstIsShared property is busted, and
that causes xmloff to write the footer-first content into the master
footer.
Change-Id: I520a4929d9d7313da65bcdcf4094f8244382377d
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/odfimport/data/fdo79269.odt | bin | 0 -> 8496 bytes | |||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/fdo79269.odt b/sw/qa/extras/odfimport/data/fdo79269.odt Binary files differnew file mode 100644 index 000000000000..2e3bf1e80985 --- /dev/null +++ b/sw/qa/extras/odfimport/data/fdo79269.odt diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 76f00bb96cd4..94eeb83d0031 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -272,6 +272,24 @@ DECLARE_ODFIMPORT_TEST(testFdo60842, "fdo60842.odt") getCell(xTable, "E1", "01/04/2012"); } +DECLARE_ODFIMPORT_TEST(testFdo79269, "fdo79269.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()); + + // The problem was that the first-footer was shared. + 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, "FooterTextFirst"); + CPPUNIT_ASSERT_EQUAL(OUString("forst"), xFooter1->getString()); + uno::Reference<text::XTextRange> xFooter = getProperty< uno::Reference<text::XTextRange> >(xPropSet, "FooterText"); + CPPUNIT_ASSERT_EQUAL(OUString("second"), xFooter->getString()); +} + DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt") { uno::Reference<drawing::XShape> xShape = getShape(1); |