tdf#82073 RTF import: handle \clcbpatraw

Quoting the RTF spec: "Same as \clcbpatN for use with table styles."

Change-Id: Icdb89bac5b41036dadb1901f18aeb21ef2512908
Reviewed-on: https://gerrit.libreoffice.org/25077
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
diff --git a/sw/qa/extras/rtfimport/data/tdf82073.rtf b/sw/qa/extras/rtfimport/data/tdf82073.rtf
new file mode 100644
index 0000000..79d9734
--- /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 21ce04c..309f79a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2599,6 +2599,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/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index 2777710..46c77bb 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -467,6 +467,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
    }
    break;
    case RTF_CLCBPAT:
    case RTF_CLCBPATRAW:
    {
        auto pValue = std::make_shared<RTFValue>(getColorTable(nParam));
        putNestedAttribute(m_aStates.top().aTableCellSprms, NS_ooxml::LN_CT_TcPrBase_shd, NS_ooxml::LN_CT_Shd_fill, pValue);