diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-04-02 14:10:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-04-02 14:27:05 +0200 |
commit | 7b58fc3dafc789aa55fff5ffef6ab83c3aa8b6e0 (patch) | |
tree | ddc04f0226971f3ebe2ff1f0b9471139bc5c2455 /sw/qa | |
parent | 8866e1986d354f0eb7eb26d78e6b6a22c6fda632 (diff) |
fdo#48104 fix RTF import of \page in inner groups
If we have a postponed page break and it's sent to dmapper during a new
inner group, we'll still have the page break request after the parser
state is popped, leading to duplicated page breaks. Instead of the
earlier workaround, just send the proper token to the domain mapper, and
it'll handle it properly.
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtftok/data/fdo48104.rtf | 6 | ||||
-rw-r--r-- | sw/qa/extras/rtftok/rtftok.cxx | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/rtftok/data/fdo48104.rtf b/sw/qa/extras/rtftok/data/fdo48104.rtf new file mode 100644 index 000000000000..64d5e5979e4f --- /dev/null +++ b/sw/qa/extras/rtftok/data/fdo48104.rtf @@ -0,0 +1,6 @@ +{\rtf1 +first page\par +\page +{second page first line\par} +second page second line\par +} diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx index f13e15dc81b0..7f9b4989e20f 100644 --- a/sw/qa/extras/rtftok/rtftok.cxx +++ b/sw/qa/extras/rtftok/rtftok.cxx @@ -75,6 +75,7 @@ public: void testFdo47036(); void testFdo46955(); void testFdo45394(); + void testFdo48104(); CPPUNIT_TEST_SUITE(RtfModelTest); #if !defined(MACOSX) && !defined(WNT) @@ -93,6 +94,7 @@ public: CPPUNIT_TEST(testFdo47036); CPPUNIT_TEST(testFdo46955); CPPUNIT_TEST(testFdo45394); + CPPUNIT_TEST(testFdo48104); #endif CPPUNIT_TEST_SUITE_END(); @@ -471,6 +473,16 @@ void RtfModelTest::testFdo45394() CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); } +void RtfModelTest::testFdo48104() +{ + load(OUString(RTL_CONSTASCII_USTRINGPARAM("fdo48104.rtf"))); + 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()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(RtfModelTest); CPPUNIT_PLUGIN_IMPLEMENT(); |