summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-01-14 17:26:35 +0100
committerMichael Stahl <mstahl@redhat.com>2013-02-05 21:25:48 +0000
commite24463c6330b0c11e3ff31c6fd373e3b32e6fc7c (patch)
tree29ff7de79cc7a05d65046ca5ce0fd23953f8e3ba /sw
parent94765a1b3f543b3b60f8c1de05048d12f2576be4 (diff)
fdo#59393 fdo#44053 fix this again and this time add a testcase as well
This was about importing RTF tables where different rows had different number of cells. In the meantime, a better implementation was added for DOCX, just using that for RTF fixes the import of this bugdoc. Also fixes a crasher while loading ooo43817-1.rtf. (cherry picked from commit d276d3f3ae112a11c8cb5768650d147cbb94275e) Change-Id: I0970275272eca7f33a442bd6acc97a4f8d9dabeb Reviewed-on: https://gerrit.libreoffice.org/1947 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo44053.rtf15
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx13
2 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo44053.rtf b/sw/qa/extras/rtfimport/data/fdo44053.rtf
new file mode 100644
index 000000000000..ef5f97567634
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo44053.rtf
@@ -0,0 +1,15 @@
+{\rtf1
+Title\par
+\trowd \cellx550\cellx7000
+0000000\cell
+Name\cell
+\pard
+\trowd \cellx550\cellx7000\row
+\trowd \cellx550\cellx1650\cellx5550\cellx7000
+\cell
+\pard \intbl
+Cell1\cell\cell\cell
+\pard
+\trowd \cellx550\cellx1650\cellx5550\cellx7000\row
+\pard\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 3dc2f1b6908b..d2a5c3189d99 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -136,6 +136,7 @@ public:
void testFdo45183();
void testFdo54612();
void testFdo58933();
+ void testFdo44053();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -222,6 +223,7 @@ void Test::run()
{"fdo45183.rtf", &Test::testFdo45183},
{"fdo54612.rtf", &Test::testFdo54612},
{"fdo58933.rtf", &Test::testFdo58933},
+ {"fdo44053.rtf", &Test::testFdo44053},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -1052,6 +1054,17 @@ void Test::testFdo58933()
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTable->getCellNames().getLength());
}
+void Test::testFdo44053()
+{
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY);
+ // The with of the table's A1 and A2 cell should equal.
+ CPPUNIT_ASSERT_EQUAL(getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position,
+ getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();