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

Thorsten Behrens thorsten at kemper.freedesktop.org
Tue May 8 08:36:42 PDT 2012


 filter/source/svg/parserfragments.cxx |   15 +++++++++++++++
 filter/source/svg/svgreader.cxx       |    5 ++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 70335974f2240be8c383910d4e9708b2a2f87c51
Author: Chr. Rossmanith <ChrRossmanith at gmx.de>
Date:   Tue May 8 09:01:23 2012 +0200

    fdo#47447 parse rgb(%,%,%) correctly
    
    Change-Id: I I I6df249fa1be37c7136baac03adcfb19fcf73e472
    Signed-off-by: Thorsten Behrens <tbehrens at suse.com>

diff --git a/filter/source/svg/parserfragments.cxx b/filter/source/svg/parserfragments.cxx
index d4b31f2..7be2f23 100644
--- a/filter/source/svg/parserfragments.cxx
+++ b/filter/source/svg/parserfragments.cxx
@@ -42,6 +42,7 @@
 
 #include "units.hxx"
 #include "tokenmap.hxx"
+#include "sal/log.hxx"
 
 using namespace ::com::sun::star;
 
@@ -74,6 +75,12 @@ void setIntColor( double& rChannel, sal_uInt8 nVal )
     rChannel = nVal/255.0;
 }
 
+void setPercentColor( double& rChannel, double nVal )
+{
+    rChannel = nVal/100.0;
+    SAL_INFO("svg", "setPercentColor " << nVal << " " << rChannel);
+}
+
 void calcRotation(std::vector<geometry::AffineMatrix2D>& rTransforms,
                   geometry::AffineMatrix2D&              rCurrTransform,
                   double                                 fRotationAngle)
@@ -176,6 +183,14 @@ namespace
                                 (real_p[assign_a(self.m_rColor.r)] >> ',' >>
                                  real_p[assign_a(self.m_rColor.g)] >> ',' >>
                                  real_p[assign_a(self.m_rColor.b)])
+                             |
+                                // rgb(percent,percent,percent)
+                                (real_p[boost::bind(&setPercentColor,
+                                                    boost::ref(self.m_rColor.r),_1)] >> "%," >>
+                                 real_p[boost::bind(&setPercentColor,
+                                                    boost::ref(self.m_rColor.g),_1)] >> "%," >>
+                                 real_p[boost::bind(&setPercentColor,
+                                                    boost::ref(self.m_rColor.b),_1)] >> "%")
                              )
                          >> ')')
                      );
commit 322963a4e82a6de7be37cd14ae1c81d315bde17a
Author: Chr. Rossmanith <ChrRossmanith at gmx.de>
Date:   Tue May 8 09:11:12 2012 +0200

    fdo#48065 clamp mnFillOpacity to 1
    
    Change-Id: I I007724e0ea4cc54a72f9bd9de9d83f887615568e
    Signed-off-by: Thorsten Behrens <tbehrens at suse.com>

diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index c25d183..a64416a 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -903,8 +903,11 @@ struct AnnotatingVisitor
             case XML_FILL_OPACITY:
                 if( aValueUtf8 == "inherit" )
                     maCurrState.mnFillOpacity = maParentStates.back().mnFillOpacity;
-                else
+                else {
                     maCurrState.mnFillOpacity = aValueUtf8.toDouble();
+                    if( maCurrState.mnFillOpacity > 1 )
+                        maCurrState.mnFillOpacity = 1;
+                }
                 break;
             case XML_STROKE_WIDTH:
             {


More information about the Libreoffice-commits mailing list