svgio/inc/svgio/svgreader/svgstyleattributes.hxx |    2 -
 svgio/source/svgreader/svgstyleattributes.cxx    |   28 ++++++++++++++++++++---
 2 files changed, 26 insertions(+), 4 deletions(-)

New commits:
commit 359f43f8e76c3bd85c3daf35b5a6d925a4c8c64f
Author: Xisco Fauli <aniste...@gmail.com>
Date:   Sat Jan 30 01:50:07 2016 +0100

    tdf#79163: SVGIO: Fix problem with opacity attribute
    
    Opacity attribute didn't work because it was always set to 1.0
    
    Change-Id: I3a2029ef23acf9d8c0f346e04341db33c6802b8e
    Reviewed-on: https://gerrit.libreoffice.org/21911
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Armin Le Grand <armin.le.gr...@cib.de>

diff --git a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx 
b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
index 02cf55d..9d589d1 100644
--- a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
+++ b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
@@ -425,7 +425,7 @@ namespace svgio
             const basegfx::BColor* getCurrentColor() const;
 
             /// Opacity content
-            SvgNumber getOpacity() const { return maOpacity; }
+            SvgNumber getOpacity() const;
             void setOpacity(const SvgNumber& rOpacity = SvgNumber()) { 
maOpacity = rOpacity; }
 
             /// Visibility
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx 
b/svgio/source/svgreader/svgstyleattributes.cxx
index 3e3fa00..e733396 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1056,7 +1056,7 @@ namespace svgio
                 return;
             }
 
-            const double fOpacity(getOpacity().getNumber());
+            const double fOpacity(getOpacity().solve(mrOwner));
 
             if(basegfx::fTools::equalZero(fOpacity))
             {
@@ -1113,7 +1113,7 @@ namespace svgio
         {
             if(!rSource.empty())
             {
-                const double fOpacity(getOpacity().getNumber());
+                const double fOpacity(getOpacity().solve(mrOwner));
 
                 if(basegfx::fTools::equalZero(fOpacity))
                 {
@@ -1210,7 +1210,7 @@ namespace svgio
             maTextDecoration(TextDecoration_notset),
             maTextAnchor(TextAnchor_notset),
             maColor(),
-            maOpacity(1.0),
+            maOpacity(),
             maVisibility(Visibility_visible),
             maTitle(),
             maDesc(),
@@ -2163,6 +2163,28 @@ namespace svgio
             return SvgNumber(1.0);
         }
 
+        SvgNumber SvgStyleAttributes::getOpacity() const
+        {
+            if(mbIsClipPathContent)
+            {
+                return SvgNumber(1.0);
+            }
+            else if(maOpacity.isSet())
+            {
+                return maOpacity;
+            }
+
+            const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle();
+
+            if(pSvgStyleAttributes)
+            {
+                return pSvgStyleAttributes->getOpacity();
+            }
+
+            // default is 1
+            return SvgNumber(1.0);
+        }
+
         FillRule SvgStyleAttributes::getFillRule() const
         {
             if(FillRule_notset != maFillRule)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to