diff options
author | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2012-05-08 09:01:23 +0200 |
---|---|---|
committer | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2012-05-08 10:25:52 +0200 |
commit | 7c11471666f92e9dfecbec23ebe73bcb0177a963 (patch) | |
tree | 10946e93d2375faedd78fd4c141d247bb1e7e7fa | |
parent | 695409f723b7a93e08cc48b47d4e7583d1432880 (diff) |
fdo#47447 parse rgb(%,%,%) correctly
Change-Id: I I I6df249fa1be37c7136baac03adcfb19fcf73e472
-rw-r--r-- | filter/source/svg/parserfragments.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/filter/source/svg/parserfragments.cxx b/filter/source/svg/parserfragments.cxx index 3de3d4b2d7ca..de290659e8e8 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)] >> "%") ) >> ')') ); |