diff --git a/sw/qa/extras/rtfimport/data/cont-section-pagebreak.rtf b/sw/qa/extras/rtfimport/data/cont-section-pagebreak.rtf new file mode 100644 index 000000000000..888dc2d0293e --- /dev/null +++ b/sw/qa/extras/rtfimport/data/cont-section-pagebreak.rtf @@ -0,0 +1,16 @@ +{\rtf1 \ansi +\fet0 \ftnbj \paperw11905 \paperh16837 \margt2267 \margb1133 \margl1417 \margr1417 + +\sectd +\sbknone +FIRST +\par +\sect +SECOND +\par +\page +\sect +THIRD +\par +\sect +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 2c119f3bf76b..379475e84d9b 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -1420,6 +1421,30 @@ DECLARE_RTFIMPORT_TEST(testNestedTable, "rhbz1065629.rtf") CPPUNIT_ASSERT_EQUAL(1, getPages()); } +DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, "cont-section-pagebreak.rtf") +{ + uno::Reference xParaSecond = getParagraph(2); + CPPUNIT_ASSERT_EQUAL(OUString("SECOND"), xParaSecond->getString()); + CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, + getProperty(xParaSecond, "BreakType")); + CPPUNIT_ASSERT_EQUAL(OUString(""), + getProperty(xParaSecond, "PageDescName")); + // actually not sure how many paragraph there should be between + // SECOND and THIRD - important is that the page break is on there + uno::Reference xParaNext = getParagraph(3); + CPPUNIT_ASSERT_EQUAL(OUString(""), xParaNext->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("Converted1"), + getProperty(xParaNext, "PageDescName")); + uno::Reference xParaThird = getParagraph(4); + CPPUNIT_ASSERT_EQUAL(OUString("THIRD"), xParaThird->getString()); + CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, + getProperty(xParaThird, "BreakType")); + CPPUNIT_ASSERT_EQUAL(OUString(""), + getProperty(xParaThird, "PageDescName")); + + CPPUNIT_ASSERT_EQUAL(2, getPages()); +} + DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf") { // The single-line document had a second fake empty para on Windows.