summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-05-18 09:04:40 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-05-18 15:10:32 +0000
commit7c105b0014b59349bd110b249e1865d9e6abbb94 (patch)
treee313698a73c23e31265552b6bac13e6e7d3d40d9
parent7879b89da30025c8efb812bb31a88f9e382b42a5 (diff)
tdf#82073 RTF import: handle \clcbpatraw
Quoting the RTF spec: "Same as \clcbpatN for use with table styles." (cherry picked from commit ceaa06bc7153387238eead0a69d874ed35241793) Conflicts: writerfilter/source/rtftok/rtfdispatchvalue.cxx Change-Id: Icdb89bac5b41036dadb1901f18aeb21ef2512908 Reviewed-on: https://gerrit.libreoffice.org/25103 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/qa/extras/rtfimport/data/tdf82073.rtf9
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx8
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx1
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);