diff options
-rw-r--r-- | sw/qa/extras/rtfimport/data/tdf50821.rtf | 10 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 4 |
3 files changed, 20 insertions, 2 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf50821.rtf b/sw/qa/extras/rtfimport/data/tdf50821.rtf new file mode 100644 index 000000000000..03f253dbe6a6 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf50821.rtf @@ -0,0 +1,10 @@ +{\rtf1 +\pard\plain +before\par +\trowd \trpaddl108\trpaddfl3 \cellx10362\pard\plain\intbl +table +\cell\row +\pard\plain +end +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 5fa67e93a2cd..5242f85e5609 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2595,6 +2595,14 @@ DECLARE_RTFIMPORT_TEST(testTdf77349, "tdf77349.rtf") CPPUNIT_ASSERT_EQUAL(OUString("graphic1"), xImage->getName()); } +DECLARE_RTFIMPORT_TEST(testTdf50821, "tdf50821.rtf") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was 0, \trpaddfl was mishandled on import. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(191), getProperty<sal_Int32>(xCell, "LeftBorderDistance")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 60c7ab47e8b8..69e4324bc4e6 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -4835,8 +4835,8 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) default: break; } - lcl_putNestedSprm(m_aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcMar, nSprm, std::make_shared<RTFValue>(aAttributes)); - lcl_putNestedSprm(m_aDefaultState.aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcMar, nSprm, std::make_shared<RTFValue>(aAttributes)); + lcl_putNestedAttribute(m_aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcMar, nSprm, std::make_shared<RTFValue>(aAttributes)); + lcl_putNestedAttribute(m_aDefaultState.aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_tcMar, nSprm, std::make_shared<RTFValue>(aAttributes)); } break; case RTF_TRPADDB: |