summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfexport/data/tdf158826_extraCR.rtf23
-rw-r--r--sw/qa/extras/rtfexport/rtfexport8.cxx11
-rw-r--r--writerfilter/source/rtftok/rtfdispatchflag.cxx4
3 files changed, 37 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf158826_extraCR.rtf b/sw/qa/extras/rtfexport/data/tdf158826_extraCR.rtf
new file mode 100644
index 000000000000..5461327da3ca
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf158826_extraCR.rtf
@@ -0,0 +1,23 @@
+{\rtf1
+\landscape\paperh5953\paperw8391\margl720\margr720\margt432\margb1728\gutter0\ltrsect
+
+
+\pagebb
+\intbl
+\pvpg\phpg
+
+\posx720\posy432
+\dxfrtext187\dfrmtxtx187\dfrmtxty0
+\wraparound\aspalpha\aspnum
+\faauto\adjustright
+\rin0\lin0\absnoovrlp1\pararsid5332093\yts39
+
+
+\shp
+
+
+a \cell b{\cell }
+\clwWidth6300\clshdrawnil \cellx6295
+\clwWidth4500\clshdrawnil \cellx10795\row
+
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport8.cxx b/sw/qa/extras/rtfexport/rtfexport8.cxx
index 3023e51dcb21..9848d0573db8 100644
--- a/sw/qa/extras/rtfexport/rtfexport8.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport8.cxx
@@ -86,6 +86,17 @@ DECLARE_RTFEXPORT_TEST(testTdf158586_lostFrame, "tdf158586_lostFrame.rtf")
// CPPUNIT_ASSERT_EQUAL(2, getPages());
}
+DECLARE_RTFEXPORT_TEST(testTdf158826_extraCR, "tdf158826_extraCR.rtf")
+{
+ // Note: this is a hand-minimized sample, and very likely doesn't follow RTF { } rules...
+
+ // The page break defined before the document content should not cause a page break
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ // There is a two-column floating table [that SHOULD be getParagraphOrTable(1)]
+ uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY_THROW);
+}
+
} // end of anonymous namespace
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx
index 72c777aab1fb..753f1c3fbba9 100644
--- a/writerfilter/source/rtftok/rtfdispatchflag.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx
@@ -520,7 +520,9 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
}
break;
case RTFKeyword::PAGEBB:
- nParam = NS_ooxml::LN_CT_PPrBase_pageBreakBefore;
+ // ignore a page break that is defined before the document content has even started
+ if (!m_bFirstRun)
+ nParam = NS_ooxml::LN_CT_PPrBase_pageBreakBefore;
break;
default:
break;