From 0f21f932081471b2a5eda820fa1a194fbf3ab85c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 29 Sep 2014 23:22:12 +0200 Subject: 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 --- sw/qa/extras/odfimport/data/fdo79269.odt | Bin 0 -> 8496 bytes sw/qa/extras/odfimport/odfimport.cxx | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 sw/qa/extras/odfimport/data/fdo79269.odt (limited to 'sw/qa/extras/odfimport') diff --git a/sw/qa/extras/odfimport/data/fdo79269.odt b/sw/qa/extras/odfimport/data/fdo79269.odt new file mode 100644 index 000000000000..2e3bf1e80985 Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo79269.odt differ 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 xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference 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 xPropSet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(false, getProperty(xPropSet, "FirstIsShared")); + + uno::Reference xFooter1 = getProperty< uno::Reference >(xPropSet, "FooterTextFirst"); + CPPUNIT_ASSERT_EQUAL(OUString("forst"), xFooter1->getString()); + uno::Reference xFooter = getProperty< uno::Reference >(xPropSet, "FooterText"); + CPPUNIT_ASSERT_EQUAL(OUString("second"), xFooter->getString()); +} + DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt") { uno::Reference xShape = getShape(1); -- cgit v1.2.3