summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfimport/data/fdo49655.rtf5
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx15
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx8
3 files changed, 28 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();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index f8200ff5907a..5e3365431b5b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1006,6 +1006,14 @@ void RTFDocumentImpl::text(OUString& rString)
return;
}
+ // Are we in the middle of the table definition? (No cell defs yet, but we already have some cell props.)
+ if (m_aStates.top().aTableCellSprms.find(NS_ooxml::LN_CT_TcPrBase_vAlign).get() &&
+ m_aStates.top().nCells == 0)
+ {
+ m_aTableBuffer.push_back(make_pair(BUFFER_UTEXT, RTFValue::Pointer_t(new RTFValue(rString))));
+ return;
+ }
+
checkFirstRun();
checkNeedPap();