diff options
author | Daniel Robertson <danlrobertson89@gmail.com> | 2015-10-10 12:43:34 -0400 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-11 06:15:35 +0000 |
commit | 91e0161dc5a0de0dcce1696aea318d919d5d04a1 (patch) | |
tree | c2e27d7137b6a81852b01eade6181ecfc372b44f /slideshow/source/engine/slide | |
parent | b6297280853a7325ac0fa226b783652b22daebd0 (diff) |
tdf#93243 slideshow: replace boost::bind
Replace boost::bind with C++11 lambdas
Change-Id: I13c500d085e6b8e80b2c067139db4ed0fffb2c71
Reviewed-on: https://gerrit.libreoffice.org/19299
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'slideshow/source/engine/slide')
-rw-r--r-- | slideshow/source/engine/slide/layer.cxx | 33 | ||||
-rw-r--r-- | slideshow/source/engine/slide/layermanager.cxx | 24 | ||||
-rw-r--r-- | slideshow/source/engine/slide/shapemanagerimpl.cxx | 8 | ||||
-rw-r--r-- | slideshow/source/engine/slide/slideimpl.cxx | 2 |
4 files changed, 24 insertions, 43 deletions
diff --git a/slideshow/source/engine/slide/layer.cxx b/slideshow/source/engine/slide/layer.cxx index 5f6ebfadc965..48dc741b9cd0 100644 --- a/slideshow/source/engine/slide/layer.cxx +++ b/slideshow/source/engine/slide/layer.cxx @@ -25,13 +25,9 @@ #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/polygon/b2dpolypolygoncutter.hxx> -#include <boost/noncopyable.hpp> #include "layer.hxx" -#include <boost/bind.hpp> - - using namespace ::com::sun::star; namespace slideshow @@ -69,10 +65,8 @@ namespace slideshow const ViewEntryVector::iterator aEnd( maViewEntries.end() ); if( (aIter=std::find_if( maViewEntries.begin(), aEnd, - boost::bind<bool>( - std::equal_to< ViewSharedPtr >(), - boost::bind( &ViewEntry::getView, _1 ), - boost::cref( rNewView )))) != aEnd ) + [&rNewView]( const ViewEntry& rViewEntry ) + { return rViewEntry.getView() == rNewView; } ) ) != aEnd ) { // already added - just return existing layer return aIter->mpViewLayer; @@ -102,10 +96,8 @@ namespace slideshow const ViewEntryVector::iterator aEnd( maViewEntries.end() ); if( (aIter=std::find_if( maViewEntries.begin(), aEnd, - boost::bind<bool>( - std::equal_to< ViewSharedPtr >(), - boost::bind( &ViewEntry::getView, _1 ), - boost::cref( rView )))) == aEnd ) + [&rView]( const ViewEntry& rViewEntry ) + { return rViewEntry.getView() == rView; } ) ) == aEnd ) { // View was not added/is already removed return ViewLayerSharedPtr(); @@ -113,10 +105,8 @@ namespace slideshow OSL_ENSURE( std::count_if( maViewEntries.begin(), aEnd, - boost::bind<bool>( - std::equal_to< ViewSharedPtr >(), - boost::bind( &ViewEntry::getView, _1 ), - boost::cref( rView ))) == 1, + [&rView]( const ViewEntry& rViewEntry ) + { return rViewEntry.getView() == rView; } ) == 1, "Layer::removeView(): view added multiple times" ); ViewLayerSharedPtr pRet( aIter->mpViewLayer ); @@ -176,10 +166,9 @@ namespace slideshow maBounds = maNewBounds; if( std::count_if( maViewEntries.begin(), maViewEntries.end(), - boost::bind( &ViewLayer::resize, - boost::bind( &ViewEntry::getViewLayer, - _1 ), - boost::cref(maBounds)) ) == 0 ) + [this]( const ViewEntry& rViewEntry ) + { return rViewEntry.getViewLayer()->resize( this->maBounds ); } + ) == 0 ) { return false; } @@ -207,9 +196,11 @@ namespace slideshow clearUpdateRanges(); } - class LayerEndUpdate : private boost::noncopyable + class LayerEndUpdate { public: + LayerEndUpdate( const LayerEndUpdate& ) = delete; + LayerEndUpdate& operator=( const LayerEndUpdate& ) = delete; explicit LayerEndUpdate( LayerSharedPtr const& rLayer ) : mpLayer( rLayer ) {} diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx index 3dbb554a53bb..332da3d823c1 100644 --- a/slideshow/source/engine/slide/layermanager.cxx +++ b/slideshow/source/engine/slide/layermanager.cxx @@ -25,7 +25,7 @@ #include <comphelper/anytostring.hxx> #include <cppuhelper/exc_hlp.hxx> -#include <boost/bind.hpp> +#include <boost/mem_fn.hpp> #include <algorithm> #include "layermanager.hxx" @@ -166,14 +166,10 @@ namespace slideshow // add View to all registered shapes manageViews( - boost::bind(&Layer::addView, - _1, - boost::cref(rView)), - // repaint on view add - boost::bind(&Shape::addViewLayer, - _1, - _2, - true) ); + [&rView]( const LayerSharedPtr& pLayer ) + { return pLayer->addView( rView ); }, + []( const ShapeSharedPtr& pShape, const ViewLayerSharedPtr& pLayer ) + { return pShape->addViewLayer( pLayer, true ); } ); // in case we haven't reached all layers from the // maAllShapes, issue addView again for good measure @@ -190,12 +186,10 @@ namespace slideshow // remove View from all registered shapes manageViews( - boost::bind(&Layer::removeView, - _1, - boost::cref(rView)), - boost::bind(&Shape::removeViewLayer, - _1, - _2) ); + [&rView]( const LayerSharedPtr& pLayer ) + { return pLayer->removeView( rView ); }, + []( const ShapeSharedPtr& pShape, const ViewLayerSharedPtr& pLayer ) + { return pShape->removeViewLayer( pLayer ); } ); // in case we haven't reached all layers from the // maAllShapes, issue removeView again for good measure diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx index 9867f09684b0..a484cae6a309 100644 --- a/slideshow/source/engine/slide/shapemanagerimpl.cxx +++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx @@ -26,7 +26,7 @@ #include "shapemanagerimpl.hxx" -#include <boost/bind.hpp> +#include <boost/mem_fn.hpp> using namespace com::sun::star; @@ -151,10 +151,8 @@ bool ShapeManagerImpl::handleMouseReleased( awt::MouseEvent const& e ) // DON'T do anything with /this/ after this point! pCont->forEach<presentation::XShapeEventListener>( - boost::bind( &presentation::XShapeEventListener::click, - _1, - boost::cref(xShape), - boost::cref(e) )); + [&xShape, &e]( const uno::Reference< presentation::XShapeEventListener >& rListener ) + { return rListener->click( xShape, e ); } ); return true; // handled this event } diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 4bb090b9e84a..0e2cf1a614aa 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -61,8 +61,6 @@ #include "targetpropertiescreator.hxx" #include "tools.hxx" - -#include <boost/bind.hpp> #include <iterator> #include <functional> #include <iostream> |