diff options
-rw-r--r-- | sw/qa/extras/rtfimport/data/tdf82073.rtf | 9 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf82073.rtf b/sw/qa/extras/rtfimport/data/tdf82073.rtf new file mode 100644 index 000000000000..79d9734de76c --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf82073.rtf @@ -0,0 +1,9 @@ +{\rtf1 +{\colortbl;\red0\green0\blue0;} +\pard\plain first line\par +\pard\plain\trowd \clcbpatraw1 \cellx5490\clcbpatraw1 \cellx9360\pard\plain +{A1 \cell} +{A2 \cell} +\row +\pard\plain last line\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index ae7af23b3ee0..2c9bc8790ce9 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2568,6 +2568,14 @@ DECLARE_RTFIMPORT_TEST(testTdf96275, "tdf96275.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(xParagraph, 1), "TextPortionType")); } +DECLARE_RTFIMPORT_TEST(testTdf82073, "tdf82073.rtf") +{ + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was -1: the background color was automatic, not black. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xCell, "BackColor")); +} + 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 2f1737bae972..cabc7f92f5d9 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3993,6 +3993,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) } break; case RTF_CLCBPAT: + case RTF_CLCBPATRAW: { auto pValue = std::make_shared<RTFValue>(getColorTable(nParam)); lcl_putNestedAttribute(m_aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_shd, NS_ooxml::LN_CT_Shd_fill, pValue); |