summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-02-02 10:27:28 +0100
committerMichael Stahl <mstahl@redhat.com>2015-02-11 15:08:09 +0000
commit3e44fcca87fc8e1354d1d735f3a10e388f2f1d0b (patch)
tree764e171ec9676473b14528f7935f674ff01e1cc1
parentf70bfb28c396dcd9184f1c0c8ad4644e38394bce (diff)
Related: tdf#88583 RTF export: need to take care of fill attributes when ...
.. building the color table (cherry picked from commit 87a5cf7db1f070cbc4a674a1c12c805a2c950856) Change-Id: I8a74640e0d51d76b910394be5210c18d89818edd Reviewed-on: https://gerrit.libreoffice.org/14392 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/qa/extras/rtfexport/data/tdf88583.odtbin0 -> 8471 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx7
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx9
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf88583.odt b/sw/qa/extras/rtfexport/data/tdf88583.odt
new file mode 100644
index 000000000000..307ab1e780d7
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf88583.odt
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 221618d56ad7..bbd969d27622 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -851,6 +851,13 @@ DECLARE_RTFEXPORT_TEST(testFdo82006, "fdo82006.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), getProperty<sal_Int32>(getParagraph(0), "ParaBottomMargin"));
}
+DECLARE_RTFEXPORT_TEST(testTdf88583, "tdf88583.odt")
+{
+ // This was FillStyle_NONE, as background color was missing from the color table during export.
+ CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle"));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00cc00), getProperty<sal_Int32>(getParagraph(1), "FillColor"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index b0261afef8ba..d85903e3befb 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -52,6 +52,7 @@
#if OSL_DEBUG_LEVEL > 1
#include <iostream>
#endif
+#include <svx/xflclit.hxx>
using ::editeng::SvxBorderLine;
using namespace ::comphelper;
@@ -1046,6 +1047,14 @@ void RtfExport::OutColorTable()
}
}
+ // TextFrame or paragraph background solid fill.
+ nMaxItem = rPool.GetItemCount2(XATTR_FILLCOLOR);
+ for (sal_uInt32 i = 0; i < nMaxItem; ++i)
+ {
+ if (const XFillColorItem* pItem = static_cast<const XFillColorItem*>(rPool.GetItem2(XATTR_FILLCOLOR, i)))
+ InsColor(pItem->GetColorValue());
+ }
+
for (size_t n = 0; n < m_aColTbl.size(); ++n)
{
const Color& rCol = m_aColTbl[ n ];