diff options
author | Helena Svobodova <hel.svo@gmail.com> | 2016-05-25 21:18:34 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-05-26 13:34:57 +0000 |
commit | f90b77d0f27294b00ceb58b21f4d644fa84a3289 (patch) | |
tree | 7c75ddb48d756fed496724f64cb45cc5f9280087 | |
parent | 9b8da7a53b7bd3b43076a7d9bc3ce735bbe7f80f (diff) |
tdf#93243 Replacing boost::bind with C++11 lambdas
Some boost::binds replaced
Change-Id: I8a0326d930921314d02285775450ac26230620ad
Reviewed-on: https://gerrit.libreoffice.org/25071
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | filter/source/svg/parserfragments.cxx | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/filter/source/svg/parserfragments.cxx b/filter/source/svg/parserfragments.cxx index 01e9d97acc8e..440226e155aa 100644 --- a/filter/source/svg/parserfragments.cxx +++ b/filter/source/svg/parserfragments.cxx @@ -130,36 +130,39 @@ namespace { using namespace ::boost::spirit::classic; + auto lambdaSetEightBitColorR = [&self](const char* pStart, const char* nChar){ setEightBitColor(self.m_rColor.r, pStart, nChar); }; + auto lambdaSetEightBitColorG = [&self](const char* pStart, const char* nChar){ setEightBitColor(self.m_rColor.g, pStart, nChar); }; + auto lambdaSetEightBitColorB = [&self](const char* pStart, const char* nChar){ setEightBitColor(self.m_rColor.b, pStart, nChar); }; + auto lambdaSetFourBitColorR = [&self](char nChar){ setFourBitColor(self.m_rColor.r, nChar); }; + auto lambdaSetFourBitColorG = [&self](char nChar){ setFourBitColor(self.m_rColor.g, nChar); }; + auto lambdaSetFourBitColorB = [&self](char nChar){ setFourBitColor(self.m_rColor.b, nChar); }; + auto lambdaSetIntColorR = [&self](sal_uInt8 nVal){ setIntColor(self.m_rColor.r, nVal); }; + auto lambdaSetIntColorG = [&self](sal_uInt8 nVal){ setIntColor(self.m_rColor.g, nVal); }; + auto lambdaSetIntColorB = [&self](sal_uInt8 nVal){ setIntColor(self.m_rColor.b, nVal); }; + auto lambdaSetPercentColorR = [&self](double nVal){ setPercentColor(self.m_rColor.r, nVal); }; + auto lambdaSetPercentColorG = [&self](double nVal){ setPercentColor(self.m_rColor.g, nVal); }; + auto lambdaSetPercentColorB = [&self](double nVal){ setPercentColor(self.m_rColor.b, nVal); }; int_parser<sal_uInt8,10,1,3> byte_p; colorExpression = ( // the #rrggbb form - ('#' >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, - boost::ref(self.m_rColor.r),_1,_2)] - >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, - boost::ref(self.m_rColor.g),_1,_2)] - >> (xdigit_p >> xdigit_p)[boost::bind(&setEightBitColor, - boost::ref(self.m_rColor.b),_1,_2)]) + ('#' >> (xdigit_p >> xdigit_p)[ lambdaSetEightBitColorR ] + >> (xdigit_p >> xdigit_p)[ lambdaSetEightBitColorG ] + >> (xdigit_p >> xdigit_p)[ lambdaSetEightBitColorB ] ) | // the #rgb form - ('#' >> xdigit_p[boost::bind(&setFourBitColor, - boost::ref(self.m_rColor.r),_1)] - >> xdigit_p[boost::bind(&setFourBitColor, - boost::ref(self.m_rColor.g),_1)] - >> xdigit_p[boost::bind(&setFourBitColor, - boost::ref(self.m_rColor.b),_1)]) + ('#' >> xdigit_p[ lambdaSetFourBitColorR ] + >> xdigit_p[ lambdaSetFourBitColorG ] + >> xdigit_p[ lambdaSetFourBitColorB ] ) | // rgb() form (str_p("rgb") >> '(' >> ( // rgb(int,int,int) - (byte_p[boost::bind(&setIntColor, - boost::ref(self.m_rColor.r),_1)] >> ',' >> - byte_p[boost::bind(&setIntColor, - boost::ref(self.m_rColor.g),_1)] >> ',' >> - byte_p[boost::bind(&setIntColor, - boost::ref(self.m_rColor.b),_1)]) + (byte_p[ lambdaSetIntColorR ] >> ',' >> + byte_p[ lambdaSetIntColorG ] >> ',' >> + byte_p[ lambdaSetIntColorB ] ) | // rgb(double,double,double) (real_p[assign_a(self.m_rColor.r)] >> ',' >> @@ -167,12 +170,9 @@ namespace 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)] >> "%") + (real_p[ lambdaSetPercentColorR ] >> "%," >> + real_p[ lambdaSetPercentColorG ] >> "%," >> + real_p[ lambdaSetPercentColorB ] >> "%") ) >> ')') ); |