[Libreoffice-commits] core.git: oox/source

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Sep 4 00:28:37 PDT 2014


 oox/source/drawingml/colorchoicecontext.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 689742b9b75250fcebf50f0d9b73052d4b10e7e1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Sep 3 19:55:35 2014 +0200

    MSO finally decided to follow the spec, fdo#83312
    
    Change-Id: I8c611b49e3bf4645736425bd33c2994ae2c28337

diff --git a/oox/source/drawingml/colorchoicecontext.cxx b/oox/source/drawingml/colorchoicecontext.cxx
index 7c38409..e255fcb 100644
--- a/oox/source/drawingml/colorchoicecontext.cxx
+++ b/oox/source/drawingml/colorchoicecontext.cxx
@@ -109,7 +109,17 @@ void ColorValueContext::onStartElement( const AttributeList& rAttribs )
         case A_TOKEN( satOff ):
         case A_TOKEN( shade ):
         case A_TOKEN( tint ):
-            mrColor.addTransformation( nElement, rAttribs.getInteger( XML_val, 0 ) );
+        {
+            OUString aValue = rAttribs.getString( XML_val, OUString() );
+            sal_Int32 nVal = 0;
+            if (aValue.endsWith("%"))
+            {
+                nVal = aValue.toDouble() * PER_PERCENT;
+            }
+            else
+                nVal = rAttribs.getInteger(XML_val, 0);
+            mrColor.addTransformation( nElement, nVal );
+        }
         break;
         case A_TOKEN( comp ):
         case A_TOKEN( gamma ):


More information about the Libreoffice-commits mailing list