[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sw/qa sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Feb 5 09:31:50 UTC 2019


 sw/qa/extras/ww8export/data/tdf121111_fillStyleNone.docx |binary
 sw/qa/extras/ww8export/ww8export3.cxx                    |   13 +++++++++++++
 sw/source/filter/ww8/ww8par6.cxx                         |    9 +++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 026c685ab480e2afd6cbbbd82d02afde643669f0
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Wed Nov 28 16:17:22 2018 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Feb 5 10:31:25 2019 +0100

    tdf#116071 ww8import: import to XATTR_FILL instead of RES_BACKGROUND
    
    The new XATTR_FILL* was introduced a few years ago and the UI
    changed to that, but .doc import was still importing into
    RES_BACKGROUND and although the property showed up OK, it
    couldn't be changed or seen by the UI and somehow
    hidden/unavailable as UNO properties.
    
    Change-Id: Iea1805a321a306994ab23bb66a354dca8e3a3d40
    Reviewed-on: https://gerrit.libreoffice.org/64186
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Tested-by: Justin Luth <justin_luth at sil.org>
    (cherry picked from commit 3539a1efb41a787237e4333ebc715db96ffacb5b)
    Reviewed-on: https://gerrit.libreoffice.org/66465
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/qa/extras/ww8export/data/tdf121111_fillStyleNone.docx b/sw/qa/extras/ww8export/data/tdf121111_fillStyleNone.docx
new file mode 100644
index 000000000000..434d182eb7ca
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf121111_fillStyleNone.docx differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 60bf801b25ef..836ee562a7b7 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -18,6 +18,7 @@
 #include <com/sun/star/text/XTextTablesSupplier.hpp>
 
 #include <drawdoc.hxx>
+#include <svx/xfillit0.hxx>
 
 class Test : public SwModelTestBase
 {
@@ -169,6 +170,18 @@ DECLARE_WW8EXPORT_TEST(testTdf120225_textControlCrossRef, "tdf120225_textControl
     CPPUNIT_ASSERT_EQUAL(OUString("Text1"), sTextFieldName);
 }
 
+DECLARE_WW8EXPORT_TEST(testTdf121111_fillStyleNone, "tdf121111_fillStyleNone.docx")
+{
+    uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Numbering - First level"),
+                                                     uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(Color(184,204,228), Color(getProperty<sal_uInt32>(xStyle, "ParaBackColor")));//R:184 G:204 B:228
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xStyle, "FillStyle"));
+
+    uno::Reference<text::XTextRange> xText(getParagraph(12));
+    CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(getProperty<sal_uInt32>(xText, "ParaBackColor")));
+    CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(xText, "FillStyle"));
+}
+
 DECLARE_WW8EXPORT_TEST(testTdf94009_zeroPgMargin, "tdf94009_zeroPgMargin.odt")
 {
     uno::Reference<beans::XPropertySet> defaultStyle(getStyles("PageStyles")->getByName("Standard"),
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 7d927c968868..5a31a8888d61 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -68,6 +68,8 @@
 #include <editeng/frmdiritem.hxx>
 #include <editeng/charhiddenitem.hxx>
 #include <i18nlangtag/mslangid.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xflclit.hxx>
 #include "sprmids.hxx"
 #include <fmtpdsc.hxx>
 #include <node.hxx>
@@ -4782,7 +4784,8 @@ void SwWW8ImplReader::Read_Shade( sal_uInt16, const sal_uInt8* pData, short nLen
         aSHD.SetWWValue( *reinterpret_cast<SVBT16 const *>(pData) );
         SwWW8Shade aSh( m_bVer67, aSHD );
 
-        NewAttr(SvxBrushItem(aSh.aColor, RES_BACKGROUND));
+        NewAttr( XFillStyleItem(drawing::FillStyle_SOLID) );
+        NewAttr( XFillColorItem(OUString(), aSh.aColor) );
     }
 }
 
@@ -4798,7 +4801,9 @@ void SwWW8ImplReader::Read_ParaBackColor(sal_uInt16, const sal_uInt8* pData, sho
         OSL_ENSURE(nLen == 10, "Len of para back colour not 10!");
         if (nLen != 10)
             return;
-        NewAttr(SvxBrushItem(ExtractColour(pData, m_bVer67), RES_BACKGROUND));
+
+        NewAttr( XFillStyleItem(drawing::FillStyle_SOLID) );
+        NewAttr( XFillColorItem(OUString(), ExtractColour(pData, m_bVer67)) );
     }
 }
 


More information about the Libreoffice-commits mailing list