diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfimport/data/rhbz1065629.rtf | 81 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 19 |
2 files changed, 100 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/rhbz1065629.rtf b/sw/qa/extras/rtfimport/data/rhbz1065629.rtf new file mode 100644 index 000000000000..b22ec506622c --- /dev/null +++ b/sw/qa/extras/rtfimport/data/rhbz1065629.rtf @@ -0,0 +1,81 @@ +{\rtf1\ansi\ansicpg1252\deff0 +{\fonttbl +\f0\froman\fcharset0 Times New Roman; +\f1\fswiss\fcharset0 Arial; +\f2\fmodern\fcharset0 Courier New; +\f3\ftech\fcharset2 Symbol; +\f4\fswiss\fcharset0 Helvetica; +} +{\info +{\*\userprops +{\propname creator}\proptype30 +{\staticval XMLmind XSL-FO Converter Professional Edition 4.6.1} +} +} +\facingp\fet0\ftnbj +\sectd +\pghsxn16114\pgwsxn12514 +\margtsxn720\margbsxn907\marglsxn907\margrsxn1080 +\headery720 +\footery547 +\pgncont\pgndec + +\par +\trowd\trleft10 +\clvertalt +\clcbpat17 +\clbrdrt\brdrs\brdrw20\brdrcf2\clbrdrb\brdrs\brdrw20\brdrcf2\clbrdrl\brdrs\brdrw20\brdrcf2\clbrdrr\brdrs\brdrw20\brdrcf2\cellx10262 +\pard\intbl +{\plain\f4\fs19\b\cf15\ulc2 +Informations client +} +\cell +\row +\trowd\trleft10 +\clvertalt +\clbrdrl\brdrs\brdrw10\brdrcf2\cellx5136 +\clvertalt +\clbrdrl\brdrs\brdrw10\brdrcf2\clbrdrr\brdrs\brdrw10\brdrcf2\cellx10262 +\pard\intbl\itap2 +{\plain\f4\fs18\cf2\ulc2 +E-mail: +} +\nestcell +{\*\nesttableprops +\trowd\trleft0 +\clvertalt +\cellx5400 +\nestrow} +\pard\intbl +\cell +\pard\intbl\itap2 +{\plain\f4\fs18\b\cf2\ulc2 +Responsable Commercial: +} +\nestcell +{\*\nesttableprops +\trowd\trleft0 +\clvertalt +\cellx5400 +\nestrow} +\pard\intbl\itap2 +{\plain\f4\fs18\cf2\ulc2 +\~ +} +\par +\pard\intbl\itap2 +{\plain\f4\fs18\cf2\ulc2 +Nom: John Doe +} +\nestcell +{\*\nesttableprops +\trowd\trleft0 +\clvertalt +\cellx5400 +\nestrow} +\pard\intbl +\cell +\row + +\pard\sect +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 42ee83c727c4..b389af65f3ed 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1364,6 +1364,25 @@ DECLARE_RTFIMPORT_TEST(testCp1000018, "cp1000018.rtf") #endif +DECLARE_RTFIMPORT_TEST(testNestedTable, "rhbz1065629.rtf") +{ + // nested table in second cell was missing + 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(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference<text::XTextRange> xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Responsable Commercial:"), xPara->getString()); + xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); + xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY); + xParaEnum = xParaEnumAccess->createEnumeration(); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("Nom: John Doe"), xPara->getString()); +} + DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf") { // The single-line document had a second fake empty para on Windows. |