[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Jul 7 04:13:01 PDT 2014
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 e262086784defe1c0f417eedf52b5de2db8e559e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sat Jul 5 13:01:38 2014 +0200
fdo#73241 RTF import: ignore page break in tables
(cherry picked from commit fdc235126d6d73f47a5b56d453e1d3db8ba3e816)
Conflicts:
sw/qa/extras/rtfimport/rtfimport.cxx
Change-Id: Ibee9fec0f421b4c2ff3d45c861bc3fcfc97cbf15
Reviewed-on: https://gerrit.libreoffice.org/10092
Reviewed-by: Muthu Subramanian K <muthusuba at gmail.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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 4a5b844..4fd6941 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1703,6 +1703,12 @@ DECLARE_RTFIMPORT_TEST(testFontOverride, "font-override.rtf")
CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName"));
}
+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 d05ac5b..cc627a5 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2273,6 +2273,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.
More information about the Libreoffice-commits
mailing list