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

Caolán McNamara caolanm at redhat.com
Tue Apr 14 02:17:15 PDT 2015


 dev/null                                   |binary
 include/svx/xgrad.hxx                      |    6 +-----
 sw/qa/extras/odfimport/data/fdo90130-1.odt |binary
 sw/qa/extras/odfimport/data/fdo90130-2.odt |binary
 sw/qa/extras/odfimport/odfimport.cxx       |   12 +++++++++++-
 sw/source/core/unocore/unoframe.cxx        |   20 ++++++++++++--------
 6 files changed, 24 insertions(+), 14 deletions(-)

New commits:
commit bc892b04144d82507ccd59953c9f4da357c2e7b4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 14 10:14:42 2015 +0100

    Related: tdf#90130 gradient transparency goes missing
    
    Change-Id: I0af8eb24dab7bb9f5831bec68f9a22ba88c2be19

diff --git a/sw/qa/extras/odfimport/data/fdo90130.odt b/sw/qa/extras/odfimport/data/fdo90130-1.odt
similarity index 100%
rename from sw/qa/extras/odfimport/data/fdo90130.odt
rename to sw/qa/extras/odfimport/data/fdo90130-1.odt
diff --git a/sw/qa/extras/odfimport/data/fdo90130-2.odt b/sw/qa/extras/odfimport/data/fdo90130-2.odt
new file mode 100644
index 0000000..6cf08950
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo90130-2.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index e2af675..a8a3742 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -559,7 +559,7 @@ DECLARE_ODFIMPORT_TEST(fdo81223, "fdo81223.odt")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0xfeffffff), nValue);
 }
 
-DECLARE_ODFIMPORT_TEST(fdo90130, "fdo90130.odt")
+DECLARE_ODFIMPORT_TEST(fdo90130_1, "fdo90130-1.odt")
 {
     uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
     uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
@@ -569,6 +569,16 @@ DECLARE_ODFIMPORT_TEST(fdo90130, "fdo90130.odt")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff3333), nValue);
 }
 
+DECLARE_ODFIMPORT_TEST(fdo90130_2, "fdo90130-2.odt")
+{
+    uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+    sal_Int32 nValue(0);
+    xFrame->getPropertyValue("BackColorTransparency") >>= nValue;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(50), nValue);
+}
+
 DECLARE_ODFIMPORT_TEST(testBnc800714, "bnc800714.fodt")
 {
     // Document's second paragraph wants to be together with the third one, but:
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index aa65873..99ee1d4 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -449,20 +449,24 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
             }
         }
 
-        if(pXFillTransparenceItem)
+        if (pXFillTransparenceItem)
         {
-            const XGradient aNullGrad(RGB_Color(COL_BLACK), RGB_Color(COL_WHITE));
             XFillTransparenceItem aXFillTransparenceItem;
-
             aXFillTransparenceItem.PutValue(*pXFillTransparenceItem);
             rToSet.Put(aXFillTransparenceItem);
         }
-        else if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID && pColTrans)
+        else if (pColTrans)
         {
-            // Fill style is set to solid, but no fill transparency is given.
-            // On the other hand, we have a BackColorTransparency, so use that.
-            aBrush.PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
-            setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet);
+            // No fill transparency is given.  On the other hand, we have a
+            // BackColorTransparency, so use that.
+            sal_Int8 nGraphicTransparency(0);
+            *pColTrans >>= nGraphicTransparency;
+            rToSet.Put(XFillTransparenceItem(nGraphicTransparency));
+            if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID)
+            {
+                aBrush.PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
+                setSvxBrushItemAsFillAttributesToTargetSet(aBrush, rToSet);
+            }
         }
 
         if(pXGradientStepCountItem)
commit 97730d49d31c5a7d680122c11640e290170e5f66
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 14 09:24:41 2015 +0100

    saw at least one of these unused by eye, search for more
    
    Change-Id: I0f863f2463c8ba1b387d5834c6ff42fb467ce796

diff --git a/include/svx/xgrad.hxx b/include/svx/xgrad.hxx
index 9231f91..9f5011e 100644
--- a/include/svx/xgrad.hxx
+++ b/include/svx/xgrad.hxx
@@ -27,11 +27,7 @@
 
 class Gradient;
 
-
-// class XGradient
-
-
-class SVX_DLLPUBLIC XGradient
+class SVX_DLLPUBLIC SAL_WARN_UNUSED XGradient
 {
 protected:
     css::awt::GradientStyle  eStyle;


More information about the Libreoffice-commits mailing list