diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-19 14:13:01 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-19 14:55:49 +0100 |
commit | db98187505c4eb95c0f815ee2646334b08445e21 (patch) | |
tree | a56a7e2603565cd5a62956de1465f0b551e8aea1 /sd | |
parent | 9db28f9ac11eba143169773012e87216a419fe84 (diff) |
sd: replace boost::bind with C++11 lambdas
Change-Id: Ib5837a056ea4131432c7b167b264019d4e32c2c8
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx | 44 |
2 files changed, 25 insertions, 26 deletions
diff --git a/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx b/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx index c5d118635060..365b73b62d66 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx @@ -27,7 +27,6 @@ #include <memory> #include <set> -#include <boost/bind.hpp> namespace sd { namespace slidesorter { namespace view { @@ -258,10 +257,8 @@ InsertAnimator::Implementation::RunContainer::const_iterator return std::find_if( maRuns.begin(), maRuns.end(), - ::boost::bind( - ::std::equal_to<sal_Int32>(), - ::boost::bind(&PageObjectRun::mnRunIndex, _1), - nRunIndex)); + [nRunIndex] (std::shared_ptr<PageObjectRun> const& rRun) + { return rRun->mnRunIndex == nRunIndex; }); } void InsertAnimator::Implementation::AddRun (const std::shared_ptr<PageObjectRun>& rRun) diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx index 030d54733e95..84de2c96506b 100644 --- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx +++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx @@ -25,7 +25,6 @@ #include <tools/gen.hxx> #include <tools/fract.hxx> -#include <boost/bind.hpp> #include <boost/noncopyable.hpp> #include <functional> @@ -260,12 +259,13 @@ void LayeredDevice::RemovePainter ( void LayeredDevice::Repaint (const vcl::Region& rRepaintRegion) { // Validate the contents of all layers (that have their own devices.) - ::std::for_each( - mpLayers->begin(), - mpLayers->end(), - ::boost::bind(&Layer::Validate, _1, mpTargetWindow->GetMapMode())); + for (auto const& it : *mpLayers) + { + it->Validate(mpTargetWindow->GetMapMode()); + } - ForAllRectangles(rRepaintRegion, ::boost::bind(&LayeredDevice::RepaintRectangle, this, _1)); + ForAllRectangles(rRepaintRegion, + [this] (Rectangle const& r) { this->RepaintRectangle(r); }); } void LayeredDevice::RepaintRectangle (const Rectangle& rRepaintRectangle) @@ -283,11 +283,10 @@ void LayeredDevice::RepaintRectangle (const Rectangle& rRepaintRectangle) // due to synchronous paints) and then copy that into the target // device. mpBackBuffer->SetMapMode(mpTargetWindow->GetMapMode()); - ::std::for_each( - mpLayers->begin(), - mpLayers->end(), - ::boost::bind(&Layer::Repaint, _1, ::boost::ref(*mpBackBuffer), rRepaintRectangle)); - + for (auto const& it : *mpLayers) + { + it->Repaint(*mpBackBuffer, rRepaintRectangle); + } DeviceCopy(*mpTargetWindow, *mpBackBuffer, rRepaintRectangle); } } @@ -296,12 +295,18 @@ void LayeredDevice::Resize() { const Size aSize (mpTargetWindow->GetSizePixel()); mpBackBuffer->SetOutputSizePixel(aSize); - ::std::for_each(mpLayers->begin(), mpLayers->end(), ::boost::bind(&Layer::Resize, _1, aSize)); + for (auto const& it : *mpLayers) + { + it->Resize(aSize); + } } void LayeredDevice::Dispose() { - ::std::for_each(mpLayers->begin(), mpLayers->end(), ::boost::bind(&Layer::Dispose, _1)); + for (auto const& it : *mpLayers) + { + it->Dispose(); + } mpLayers->clear(); } @@ -414,7 +419,7 @@ void Layer::Validate (const MapMode& rMapMode) mpLayerDevice->SetMapMode(rMapMode); ForAllRectangles( aRegion, - ::boost::bind(&Layer::ValidateRectangle, this, _1)); + [this] (Rectangle const& r) { return this->ValidateRectangle(r); }); } } @@ -447,13 +452,10 @@ void Layer::Repaint ( } else { - ::std::for_each( - maPainters.begin(), - maPainters.end(), - ::boost::bind(&ILayerPainter::Paint, - _1, - ::boost::ref(rTargetDevice), - rRepaintRectangle)); + for (auto const& it : maPainters) + { + it->Paint(rTargetDevice, rRepaintRectangle); + } } } |