[Libreoffice-commits] core.git: sw/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Feb 2 01:54:29 PST 2015


 sw/qa/extras/rtfexport/data/tdf88583.odt |binary
 sw/qa/extras/rtfexport/rtfexport.cxx     |    7 +++++++
 sw/source/filter/ww8/rtfexport.cxx       |    9 +++++++++
 3 files changed, 16 insertions(+)

New commits:
commit 87a5cf7db1f070cbc4a674a1c12c805a2c950856
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Feb 2 10:27:28 2015 +0100

    RTF export: need to take care of fill attributes when building the color table
    
    Change-Id: Iab7b4941e9b41249f2a30fa6139313239a98c501
    Reviewed-on: https://gerrit.libreoffice.org/14276
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/rtfexport/data/tdf88583.odt b/sw/qa/extras/rtfexport/data/tdf88583.odt
new file mode 100644
index 0000000..307ab1e
Binary files /dev/null and b/sw/qa/extras/rtfexport/data/tdf88583.odt differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 2925605..438cb2d 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -852,6 +852,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 e39b18e..ffc60d8 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -45,6 +45,7 @@
 #if OSL_DEBUG_LEVEL > 1
 #include <iostream>
 #endif
+#include <svx/xflclit.hxx>
 
 using ::editeng::SvxBorderLine;
 using namespace ::comphelper;
@@ -1041,6 +1042,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 ];


More information about the Libreoffice-commits mailing list