diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-09-24 09:41:02 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-09-24 10:41:33 +0200 |
commit | af6b7d8ba30d395e5f4a17876526434cf0a06005 (patch) | |
tree | b66020b08b0247b5afcc26accaf0469f6e21da13 /sw/qa | |
parent | da9acd209918ac26b44bddcf7b38b8887d23bfef (diff) |
fdo#49655 fix RTF import of text in the middle of table definition
Usually table text comes after the \intbl control word, but it turns out
text is allowed earlier. Make sure such text is buffered, otherwise
we'll send paragraph / run properties to the dmapper in the middle of
table properties, which is obviously not allowed.
Change-Id: I34f1df7e171316a7d926179689627301860d492f
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo49655.rtf | 5 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo49655.rtf b/sw/qa/extras/rtfimport/data/fdo49655.rtf new file mode 100644 index 000000000000..60f90fc527c0 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo49655.rtf @@ -0,0 +1,5 @@ +{\rtf1 +{\colortbl \red0\green0\blue0;\red128\green128\blue128;\red255\green255\blue255;} +\trowd \clvertalt \clbrdrt\brdrw15\brdrs \clbrdrl\brdrw15\brdrs \clbrdrb\brdrw15\brdrs \clbrdrr\brdrw15\brdrs \clcbpat1\cellx9600 \intbl\qc\cf2\b Travaux Exceptionnels de Jardinage N 12.03.0005.TEJ \b0\cell \row +} +\pard\par diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 9d5676157a63..873213b66315 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -111,6 +111,7 @@ public: void testFdo52052(); void testInk(); void testFdo52389(); + void testFdo49655(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -161,6 +162,7 @@ public: CPPUNIT_TEST(testFdo52052); CPPUNIT_TEST(testInk); CPPUNIT_TEST(testFdo52389); + CPPUNIT_TEST(testFdo49655); #endif CPPUNIT_TEST_SUITE_END(); @@ -970,6 +972,19 @@ void Test::testFdo52389() CPPUNIT_ASSERT_EQUAL(6, getLength()); } +void Test::testFdo49655() +{ + /* + * The problem was that the table was not imported due to the ' ' string in the middle of the table definition. + * + * xray ThisComponent.TextTables.Count 'was 0 + */ + load("fdo49655.rtf"); + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |