summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-14 10:50:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-03-14 20:48:34 +0000
commit3fbab40c16d272e9c34e3923e685945cb8f94c1f (patch)
tree296b1e96ace7e925e80b1db9d70e5613718fd712 /sw/qa
parent9f1ae90a5c978fe68aee12fbc4d4c50a38d1324e (diff)
fdo#69289 RTF import: handle cells with zero width
Change-Id: I31b12a5afa5d501d57b56f515ee1d2fd46a09b32 (cherry picked from commit 3e2cda224e4119b31d85263ff16a383e693dcbbd) Reviewed-on: https://gerrit.libreoffice.org/8585 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo69289.rtf6
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx10
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo69289.rtf b/sw/qa/extras/rtfimport/data/fdo69289.rtf
new file mode 100644
index 000000000000..96054a98dd29
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo69289.rtf
@@ -0,0 +1,6 @@
+{\rtf\ansi
+{
+\trowd\trgaph30\trleft-30\trrh256\clvertalb\cellx1280\clvertalb\cellx1280\clvertalb\cellx2560\pard\plain\intbl
+\ql a\cell\ql b\cell\ql c\cell\row
+}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 0a16ab4ee94a..a8d8fd797768 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1566,6 +1566,16 @@ DECLARE_RTFIMPORT_TEST(testCharColor, "char-color.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x365F91), getProperty<sal_Int32>(getParagraph(1), "CharColor"));
}
+DECLARE_RTFIMPORT_TEST(testFdo69289, "fdo69289.rtf")
+{
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY);
+ // There were only 2 cells (1 separators) in the table, should be 3 (2 separators).
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */