summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-26 08:56:05 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-11-10 11:47:56 +0000
commit610e6fddbc19dd2ac23b6a6cf4d8cbfb0dcf589a (patch)
tree5e5716382a1e8761e11bf45e5503db4ecb482428 /sw
parent98ef16db0d228ebc0e7bad0290dcc9d3f1d6469b (diff)
tdf#59454 RTF import: handle section break right before a table
DOCX import could handle this situation, as commit 2e8aad6d45c53d554ccaf26de998ede708cfc289 (fdo#39056 fdo#75431 Section Properties if section starts with table, 2014-04-18) added support for this situation, in case NS_ooxml::LN_tblStart/End is emitted by the tokenizer. Fix the problem by sending these tokens in the RTF tokenizer as well, at least for non-nested tables. Change-Id: Ifedb121754634529c27820dd5175e7f9e24019e1 (cherry picked from commit e57752170e604c85a6fe8aeaa38784796e00bab1) Reviewed-on: https://gerrit.libreoffice.org/19878 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/tdf59454.rtf8
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx6
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf59454.rtf b/sw/qa/extras/rtfimport/data/tdf59454.rtf
new file mode 100644
index 000000000000..b10820ad979a
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf59454.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+foo\par
+\sect\sectd
+\trowd\cellx980\cellx11480\cellx14000\pard\plain \intbl\itap1\s33\qj\hyphpar1 \fs24 \qc\hyphpar1 A1\cell
+\pard\plain \intbl\itap1\s33\qj\hyphpar1 \fs24 \qc\hyphpar1 B1\cell
+\pard\plain \intbl\itap1\s33\qj\hyphpar1 \fs24 \qc\hyphpar1 C1\cell
+\trowd\cellx980\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clvertalt\cellx11480\clbrdrt\brdrs\brdrw10\clbrdrl\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clvertalt\cellx14000\row
+\pard\plain bar\par }
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index c7f34c2c95e3..b718572c46e9 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2344,6 +2344,12 @@ DECLARE_RTFIMPORT_TEST(testTdf94435, "tdf94435.rtf")
CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust")));
}
+DECLARE_RTFIMPORT_TEST(testTdf59454, "tdf59454.rtf")
+{
+ // This was 1, section break was ignored right before a table.
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */