[Libreoffice-commits] core.git: basegfx/source basegfx/test

Mario J. Rugiero mrugiero at gmail.com
Mon Oct 26 05:49:27 UTC 2015


 basegfx/source/range/b2dpolyrange.cxx    |    5 +----
 basegfx/source/range/b2drangeclipper.cxx |   23 +++++++----------------
 basegfx/test/boxclipper.cxx              |   24 ++++++------------------
 3 files changed, 14 insertions(+), 38 deletions(-)

New commits:
commit 32b54f97d1be1257090437a3e959aa618ace6018
Author: Mario J. Rugiero <mrugiero at gmail.com>
Date:   Sun Oct 25 20:00:08 2015 -0300

    Replace boost::bind by lambdas in basegfx tree.
    
    Change-Id: I8f72bec11b5dfd71cc60a18b980629c176d43f49
    Reviewed-on: https://gerrit.libreoffice.org/19595
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/basegfx/source/range/b2dpolyrange.cxx b/basegfx/source/range/b2dpolyrange.cxx
index 95982a6..25117cb 100644
--- a/basegfx/source/range/b2dpolyrange.cxx
+++ b/basegfx/source/range/b2dpolyrange.cxx
@@ -24,7 +24,6 @@
 #include <basegfx/tuple/b2dtuple.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 
-#include <boost/bind.hpp>
 #include <algorithm>
 #include <vector>
 
@@ -80,9 +79,7 @@ namespace basegfx
             const std::vector<B2DRange>::const_iterator aEnd( maRanges.end() );
             return std::any_of( maRanges.begin(),
                                  aEnd,
-                                 boost::bind<bool>( boost::mem_fn( &B2DRange::overlaps ),
-                                                    _1,
-                                                    boost::cref(rRange) ) );
+                                 [&rRange](const B2DRange& aRange) { return aRange.overlaps(rRange); } );
         }
 
         B2DPolyPolygon solveCrossovers() const
diff --git a/basegfx/source/range/b2drangeclipper.cxx b/basegfx/source/range/b2drangeclipper.cxx
index d39c33c..7ddc85c 100644
--- a/basegfx/source/range/b2drangeclipper.cxx
+++ b/basegfx/source/range/b2drangeclipper.cxx
@@ -29,7 +29,6 @@
 #include <basegfx/polygon/b2dpolypolygontools.hxx>
 
 #include <o3tl/vector_pool.hxx>
-#include <boost/bind.hpp>
 #include <boost/next_prior.hpp>
 
 #include <algorithm>
@@ -496,11 +495,7 @@ namespace basegfx
                 B2DPolygon aRes;
                 std::for_each( maPoints.begin(),
                                maPoints.end(),
-                               boost::bind(
-                     &B2DPolygon::append,
-                                   boost::ref(aRes),
-                                   _1,
-                                   1 ) );
+                               [&aRes](const B2DPoint& aPoint) mutable { aRes.append(aPoint, 1); });
                 aRes.setClosed( true );
                 return aRes;
             }
@@ -748,10 +743,7 @@ namespace basegfx
             // rect is regarded _outside_ any rects whose events have
             // started earlier
             first = std::find_if(first, last,
-                                 boost::bind(
-                         &isSameRect,
-                                     _1,
-                                     boost::cref(rCurrRect)));
+                                 [&rCurrRect](ActiveEdge& anEdge) { return isSameRect(anEdge, rCurrRect); });
 
             if(first == last)
                 return;
@@ -907,12 +899,11 @@ namespace basegfx
 
             std::for_each( aSweepLineEvents.begin(),
                            aSweepLineEvents.end(),
-                           boost::bind(
-                               &handleSweepLineEvent,
-                               _1,
-                               boost::ref(aActiveEdgeList),
-                               boost::ref(aPolygonPool),
-                               boost::ref(aRes)) );
+                           [&](SweepLineEvent& aSweepLineEvent) mutable { handleSweepLineEvent(
+                               aSweepLineEvent,
+                               aActiveEdgeList,
+                               aPolygonPool,
+                               aRes); } );
 
             return aRes;
         }
diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx
index c6770d3..92edbdb 100644
--- a/basegfx/test/boxclipper.cxx
+++ b/basegfx/test/boxclipper.cxx
@@ -35,8 +35,6 @@
 #include <basegfx/numeric/ftools.hxx>
 #include <comphelper/random.hxx>
 
-#include <boost/bind.hpp>
-
 #include <boxclipper.hxx>
 
 using namespace ::basegfx;
@@ -168,14 +166,9 @@ public:
             OUString::createFromAscii(randomSvg), false, 0);
         std::for_each(randomPoly.begin(),
                       randomPoly.end(),
-                      boost::bind(
-             &B2DPolyRange::appendElement,
-                          boost::ref(aRandomIntersections),
-                          boost::bind(
-                 &B2DPolygon::getB2DRange,
-                              _1),
-                          B2VectorOrientation::Negative,
-                          1));
+                      [this](const B2DPolygon& aPolygon) mutable {
+                          this->aRandomIntersections.appendElement(aPolygon.getB2DRange(),
+                              B2VectorOrientation::Negative, 1); } );
 #endif
     }
 
@@ -223,14 +216,9 @@ public:
         // now, sort all polygons with increasing 0th point
         std::sort(aRes.begin(),
                   aRes.end(),
-                  boost::bind(
-                      &compare,
-                      boost::bind(
-                          &B2DPolygon::getB2DPoint,
-                          _1,0),
-                      boost::bind(
-                          &B2DPolygon::getB2DPoint,
-                          _2,0)));
+                  [](const B2DPolygon& aPolygon1, const B2DPolygon& aPolygon2) {
+                      return compare(aPolygon1.getB2DPoint(0),
+                          aPolygon2.getB2DPoint(0)); } );
 
         return aRes;
     }


More information about the Libreoffice-commits mailing list