[Libreoffice-commits] .: Branch 'libreoffice-3-5' - writerperfect/source

Fridrich Strba fridrich at kemper.freedesktop.org
Wed May 30 00:47:46 PDT 2012


 writerperfect/source/filter/OdgGenerator.cxx |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 19b2134aeeeca1c90736b76ffda42ba9bb570fba
Author: Brennan Vincent <brennanv at email.arizona.edu>
Date:   Tue May 29 19:17:51 2012 -0700

    Handle opacity in gradients
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/writerperfect/source/filter/OdgGenerator.cxx b/writerperfect/source/filter/OdgGenerator.cxx
index 79722e8..9fc3044 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -1204,16 +1204,27 @@ void OdgGeneratorPrivate::_writeGraphicsStyle()
             if (mxStyle["svg:cy"])
                 pDrawGradientElement->addAttribute("draw:cy", mxStyle["svg:cy"]->getStr());
             if (mxGradient[1]["svg:stop-opacity"])
-                pDrawGradientElement->addAttribute("draw:start-intensity", mxGradient[1]["svg:stop-opacity"]->getStr());
+            {
+                pDrawOpacityElement->addAttribute("draw:start", mxGradient[1]["svg:stop-opacity"]->getStr());
+                bUseOpacityGradient = true;
+            }
             else
-                pDrawGradientElement->addAttribute("draw:start-intensity", "100%");
+                pDrawOpacityElement->addAttribute("draw:start", "100%");
             if (mxGradient[0]["svg:stop-opacity"])
-                pDrawGradientElement->addAttribute("draw:end-intensity", mxGradient[0]["svg:stop-opacity"]->getStr());
+            {
+                pDrawOpacityElement->addAttribute("draw:end", mxGradient[0]["svg:stop-opacity"]->getStr());
+                bUseOpacityGradient = true;
+            }
             else
-                pDrawGradientElement->addAttribute("draw:end-intensity", "100%");
+                pDrawOpacityElement->addAttribute("draw:end", "100%");
             pDrawGradientElement->addAttribute("draw:border", "0%");
             mGraphicsGradientStyles.push_back(pDrawGradientElement);
             mGraphicsGradientStyles.push_back(new TagCloseElement("draw:gradient"));
+            if (bUseOpacityGradient)
+            {
+                mGraphicsGradientStyles.push_back(pDrawOpacityElement);
+                mGraphicsGradientStyles.push_back(new TagCloseElement("draw:opacity"));
+            }
         }
 
         if(!bUseOpacityGradient)


More information about the Libreoffice-commits mailing list