summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfimport/data/fdo58646.rtf7
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx8
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx4
3 files changed, 18 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo58646.rtf b/sw/qa/extras/rtfimport/data/fdo58646.rtf
new file mode 100644
index 000000000000..4314272e54a9
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo58646.rtf
@@ -0,0 +1,7 @@
+{\rtf1
+\sbknone
+\titlepg
+first page
+\page\par
+second page
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index f1e9626d6fc4..ab8ac50e4817 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -138,6 +138,7 @@ public:
void testFdo58933();
void testFdo44053();
void testFdo48440();
+ void testFdo58646();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -247,6 +248,7 @@ void Test::run()
{"fdo58933.rtf", &Test::testFdo58933},
{"fdo44053.rtf", &Test::testFdo44053},
{"fdo48440.rtf", &Test::testFdo48440},
+ {"fdo58646.rtf", &Test::testFdo58646},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1070,6 +1072,12 @@ void Test::testFdo48440()
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
+void Test::testFdo58646()
+{
+ // Page break was ignored inside a continous section, on title page.
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 4f47d9d3be48..3aed3b4ee1fb 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1804,7 +1804,9 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
{
// If we're inside a continous section, we should send a section break, not a page one.
RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_sprm::LN_SBkc);
- if (pBreak.get() && !pBreak->getInt())
+ // Unless we're on a title page.
+ RTFValue::Pointer_t pTitlePg = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_titlePg);
+ if ((pBreak.get() && !pBreak->getInt()) && !(pTitlePg.get() && pTitlePg->getInt()))
{
if (m_bWasInFrame)
{