sw/qa/extras/rtfimport/data/fdo73241.rtf | 8 ++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 6 ++++++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 4 ++++ 3 files changed, 18 insertions(+)
New commits: commit fdc235126d6d73f47a5b56d453e1d3db8ba3e816 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sat Jul 5 13:01:38 2014 +0200 fdo#73241 RTF import: ignore page break in tables Change-Id: Ibee9fec0f421b4c2ff3d45c861bc3fcfc97cbf15 diff --git a/sw/qa/extras/rtfimport/data/fdo73241.rtf b/sw/qa/extras/rtfimport/data/fdo73241.rtf new file mode 100644 index 0000000..b919e25 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo73241.rtf @@ -0,0 +1,8 @@ +{\rtf1 +\pard\plain Before.\par +\trowd \cellx4703\cellx9514\pard\plain\intbl +{\page First cell\cell Second cell\cell } +\pard\plain \intbl +{\trowd \cellx4703\cellx9514\row } +\pard\plain After.\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 81b88bb..0adabdc 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1768,6 +1768,12 @@ DECLARE_RTFIMPORT_TEST(testColumnBreak, "column-break.rtf") CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); } +DECLARE_RTFIMPORT_TEST(testFdo73241, "fdo73241.rtf") +{ + // This was 2, page break in table wasn't ignored. + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 4f8649f..021a626 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2261,6 +2261,10 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) break; case RTF_PAGE: { + // Ignore page breaks inside tables. + if (m_aStates.top().pCurrentBuffer == &m_aTableBufferStack.back()) + break; + // If we're inside a continuous section, we should send a section break, not a page one. RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type); // Unless we're on a title page. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits