summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChr. Rossmanith <ChrRossmanith@gmx.de>2012-05-08 09:01:23 +0200
committerThorsten Behrens <tbehrens@suse.com>2012-05-08 17:34:43 +0200
commit70335974f2240be8c383910d4e9708b2a2f87c51 (patch)
tree7cd63d35efec9498ff6a817ca477eb7370bc75c4
parent322963a4e82a6de7be37cd14ae1c81d315bde17a (diff)
fdo#47447 parse rgb(%,%,%) correctly
Change-Id: I I I6df249fa1be37c7136baac03adcfb19fcf73e472 Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
-rw-r--r--filter/source/svg/parserfragments.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/filter/source/svg/parserfragments.cxx b/filter/source/svg/parserfragments.cxx
index d4b31f28d1de..7be2f23317b0 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)] >> "%")
)
>> ')')
);