summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorDaniel Robertson <danlrobertson89@gmail.com>2015-08-01 11:27:08 -0400
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-08-08 12:27:55 +0000
commit717b23ef2765678a5598d652956edd77d2d62fc5 (patch)
treee2a539af458ffec65bd34be119e0b4754a7c18b2 /slideshow
parent0257b5c9edba1fda1c8ada32fc9e2378c3847726 (diff)
tdf#92459 replace deprecated o3tl features
Replace deprecated features from the o3tl including select1st and select2nd with lambda expressions. Change-Id: I0cb1aedc3e193c52d25e2837a47d9d90c898079e Reviewed-on: https://gerrit.libreoffice.org/17459 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/inc/pch/precompiled_slideshow.hxx1
-rw-r--r--slideshow/source/engine/pointersymbol.cxx23
-rw-r--r--slideshow/source/engine/pointersymbol.hxx1
-rw-r--r--slideshow/source/engine/rehearsetimingsactivity.cxx21
-rw-r--r--slideshow/source/engine/slide/layermanager.cxx15
-rw-r--r--slideshow/source/engine/slide/shapemanagerimpl.cxx22
-rw-r--r--slideshow/source/engine/slide/slideimpl.cxx23
-rw-r--r--slideshow/source/engine/waitsymbol.cxx22
-rw-r--r--slideshow/source/engine/waitsymbol.hxx1
-rw-r--r--slideshow/test/testshape.cxx16
10 files changed, 49 insertions, 96 deletions
diff --git a/slideshow/inc/pch/precompiled_slideshow.hxx b/slideshow/inc/pch/precompiled_slideshow.hxx
index 96a8bb96b4d6..e41362e2696d 100644
--- a/slideshow/inc/pch/precompiled_slideshow.hxx
+++ b/slideshow/inc/pch/precompiled_slideshow.hxx
@@ -189,7 +189,6 @@
#include <limits>
#include <map>
#include <math.h>
-#include <o3tl/compat_functional.hxx>
#include <osl/diagnose.h>
#include <osl/diagnose.hxx>
#include <queue>
diff --git a/slideshow/source/engine/pointersymbol.cxx b/slideshow/source/engine/pointersymbol.cxx
index 20dd121ad877..eed4056aa79b 100644
--- a/slideshow/source/engine/pointersymbol.cxx
+++ b/slideshow/source/engine/pointersymbol.cxx
@@ -18,7 +18,6 @@
*/
-#include <boost/current_function.hpp>
#include <canvas/canvastools.hxx>
#include <comphelper/anytostring.hxx>
@@ -33,7 +32,6 @@
#include "pointersymbol.hxx"
#include "eventmultiplexer.hxx"
-#include <o3tl/compat_functional.hxx>
#include <algorithm>
@@ -68,9 +66,8 @@ PointerSymbol::PointerSymbol( uno::Reference<rendering::XBitmap> const & xBitm
{
std::for_each( rViewContainer.begin(),
rViewContainer.end(),
- boost::bind( &PointerSymbol::viewAdded,
- this,
- _1 ));
+ [&]( const UnoViewSharedPtr& sp )
+ { this->viewAdded(sp); } );
}
void PointerSymbol::setVisible( const bool bVisible )
@@ -147,11 +144,9 @@ void PointerSymbol::viewRemoved( const UnoViewSharedPtr& rView )
maViews.erase(
std::remove_if(
maViews.begin(), maViews.end(),
- boost::bind(
- std::equal_to<UnoViewSharedPtr>(),
- rView,
- // select view:
- boost::bind( o3tl::select1st<ViewsVecT::value_type>(), _1 ) ) ),
+ [&rView]
+ ( const ::std::pair< UnoViewSharedPtr, cppcanvas::CustomSpriteSharedPtr >& cp )
+ { return rView == cp.first; } ),
maViews.end() );
}
@@ -162,11 +157,9 @@ void PointerSymbol::viewChanged( const UnoViewSharedPtr& rView )
std::find_if(
maViews.begin(),
maViews.end(),
- boost::bind(
- std::equal_to<UnoViewSharedPtr>(),
- rView,
- // select view:
- boost::bind( o3tl::select1st<ViewsVecT::value_type>(), _1 ))));
+ [&rView]
+ ( const ::std::pair< UnoViewSharedPtr, cppcanvas::CustomSpriteSharedPtr >& cp )
+ { return rView == cp.first; } ) );
OSL_ASSERT( aModifiedEntry != maViews.end() );
if( aModifiedEntry == maViews.end() )
diff --git a/slideshow/source/engine/pointersymbol.hxx b/slideshow/source/engine/pointersymbol.hxx
index 4d9a89d53fd3..8a7517ffd896 100644
--- a/slideshow/source/engine/pointersymbol.hxx
+++ b/slideshow/source/engine/pointersymbol.hxx
@@ -22,7 +22,6 @@
#include "unoview.hxx"
#include <boost/shared_ptr.hpp>
-#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
#include <vector>
diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx
index a0c271d1e347..966bfc37d421 100644
--- a/slideshow/source/engine/rehearsetimingsactivity.cxx
+++ b/slideshow/source/engine/rehearsetimingsactivity.cxx
@@ -46,7 +46,6 @@
#include "rehearsetimingsactivity.hxx"
#include <boost/bind.hpp>
-#include <o3tl/compat_functional.hxx>
#include <algorithm>
using namespace com::sun::star;
@@ -355,13 +354,10 @@ void RehearseTimingsActivity::viewAdded( const UnoViewSharedPtr& rView )
void RehearseTimingsActivity::viewRemoved( const UnoViewSharedPtr& rView )
{
maViews.erase(
- std::remove_if(
- maViews.begin(), maViews.end(),
- boost::bind(
- std::equal_to<UnoViewSharedPtr>(),
- rView,
- // select view:
- boost::bind( o3tl::select1st<ViewsVecT::value_type>(), _1 ))),
+ std::remove_if( maViews.begin(), maViews.end(),
+ [&rView]
+ ( const ::std::pair< UnoViewSharedPtr, cppcanvas::CustomSpriteSharedPtr >& cp )
+ { return rView == cp.first; } ),
maViews.end() );
}
@@ -372,11 +368,10 @@ void RehearseTimingsActivity::viewChanged( const UnoViewSharedPtr& rView )
std::find_if(
maViews.begin(),
maViews.end(),
- boost::bind(
- std::equal_to<UnoViewSharedPtr>(),
- rView,
- // select view:
- boost::bind( o3tl::select1st<ViewsVecT::value_type>(), _1 ))));
+ [&rView]
+ ( const ::std::pair< UnoViewSharedPtr, cppcanvas::CustomSpriteSharedPtr >& cp )
+ { return rView == cp.first; } )
+ );
OSL_ASSERT( aModifiedEntry != maViews.end() );
if( aModifiedEntry == maViews.end() )
diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx
index 7e0279920b5d..6a1f924d089e 100644
--- a/slideshow/source/engine/slide/layermanager.cxx
+++ b/slideshow/source/engine/slide/layermanager.cxx
@@ -29,8 +29,6 @@
#include <boost/bind.hpp>
#include <algorithm>
-#include <o3tl/compat_functional.hxx>
-
#include "layermanager.hxx"
using namespace ::com::sun::star;
@@ -150,11 +148,10 @@ namespace slideshow
// clear all viewlayers, dump everything but the
// background layer - this will also remove all shape
// sprites
- std::for_each(maAllShapes.begin(),
- maAllShapes.end(),
- boost::bind( &Shape::clearAllViewLayers,
- boost::bind( o3tl::select1st<LayerShapeMap::value_type>(),
- _1 )));
+ std::for_each( maAllShapes.begin(),
+ maAllShapes.end(),
+ []( const ::std::pair< ShapeSharedPtr, LayerWeakPtr >& cp )
+ { cp.first->clearAllViewLayers(); } );
for (LayerShapeMap::iterator
iShape (maAllShapes.begin()),
@@ -262,8 +259,8 @@ namespace slideshow
// render all shapes
std::for_each( maAllShapes.begin(),
maAllShapes.end(),
- boost::bind(&Shape::render,
- boost::bind( ::o3tl::select1st<LayerShapeMap::value_type>(), _1)) );
+ []( const ::std::pair< ShapeSharedPtr, LayerWeakPtr >& cp )
+ { cp.first->render(); } );
}
void LayerManager::addShape( const ShapeSharedPtr& rShape )
diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx
index c9528252af97..3ec7a9c15840 100644
--- a/slideshow/source/engine/slide/shapemanagerimpl.cxx
+++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx
@@ -29,8 +29,6 @@
#include <boost/bind.hpp>
-#include <o3tl/compat_functional.hxx>
-
using namespace com::sun::star;
namespace slideshow {
@@ -69,24 +67,16 @@ void ShapeManagerImpl::activate( bool bSlideBackgoundPainted )
uno::Reference<presentation::XShapeEventListener> xDummyListener;
std::for_each( mrGlobalListenersMap.begin(),
mrGlobalListenersMap.end(),
- boost::bind( &ShapeManagerImpl::listenerAdded,
- this,
- boost::cref(xDummyListener),
- boost::bind(
- o3tl::select1st<ShapeEventListenerMap::value_type>(),
- _1 )));
+ [&xDummyListener, this]( const ::std::pair< ShapeEventListenerMap::key_type,
+ ShapeEventListenerMap::mapped_type >& cp )
+ { this->listenerAdded(xDummyListener, cp.first); } );
// clone cursor map
std::for_each( mrGlobalCursorMap.begin(),
mrGlobalCursorMap.end(),
- boost::bind( &ShapeManagerImpl::cursorChanged,
- this,
- boost::bind(
- o3tl::select1st<ShapeCursorMap::value_type>(),
- _1 ),
- boost::bind(
- o3tl::select2nd<ShapeCursorMap::value_type>(),
- _1 )));
+ [this]( const ::std::pair< ShapeCursorMap::key_type,
+ ShapeCursorMap::mapped_type >& cp )
+ { this->cursorChanged(cp.first, cp.second); } );
if( mpLayerManager )
mpLayerManager->activate( bSlideBackgoundPainted );
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx
index 079139377720..3d3c4049693f 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -62,7 +62,6 @@
#include "targetpropertiescreator.hxx"
#include "tools.hxx"
-#include <o3tl/compat_functional.hxx>
#include <boost/bind.hpp>
#include <iterator>
@@ -582,13 +581,9 @@ SlideBitmapSharedPtr SlideImpl::getCurrentSlideBitmap( const UnoViewSharedPtr& r
const VectorOfVectorOfSlideBitmaps::iterator aEnd( maSlideBitmaps.end() );
if( (aIter=std::find_if( maSlideBitmaps.begin(),
aEnd,
- boost::bind(
- std::equal_to<UnoViewSharedPtr>(),
- rView,
- // select view:
- boost::bind(
- o3tl::select1st<VectorOfVectorOfSlideBitmaps::value_type>(),
- _1 )))) == aEnd )
+ [&rView]
+ ( const ::std::pair< UnoViewSharedPtr, VectorOfSlideBitmaps >& cp )
+ { return rView == cp.first; } ) ) == aEnd )
{
// corresponding view not found - maybe view was not
// added to Slide?
@@ -656,14 +651,10 @@ void SlideImpl::viewRemoved( const UnoViewSharedPtr& rView )
maSlideBitmaps.erase(
std::remove_if( maSlideBitmaps.begin(),
aEnd,
- boost::bind(
- std::equal_to<UnoViewSharedPtr>(),
- rView,
- // select view:
- boost::bind(
- o3tl::select1st<VectorOfVectorOfSlideBitmaps::value_type>(),
- _1 ))),
- aEnd );
+ [&rView]
+ ( const ::std::pair< UnoViewSharedPtr, VectorOfSlideBitmaps >& cp )
+ { return rView == cp.first; } ),
+ aEnd );
}
void SlideImpl::viewChanged( const UnoViewSharedPtr& rView )
diff --git a/slideshow/source/engine/waitsymbol.cxx b/slideshow/source/engine/waitsymbol.cxx
index 2017d7419ed1..9d5f285d226f 100644
--- a/slideshow/source/engine/waitsymbol.cxx
+++ b/slideshow/source/engine/waitsymbol.cxx
@@ -33,7 +33,6 @@
#include "waitsymbol.hxx"
#include "eventmultiplexer.hxx"
-#include <o3tl/compat_functional.hxx>
#include <algorithm>
@@ -70,9 +69,8 @@ WaitSymbol::WaitSymbol( uno::Reference<rendering::XBitmap> const & xBitmap,
{
std::for_each( rViewContainer.begin(),
rViewContainer.end(),
- boost::bind( &WaitSymbol::viewAdded,
- this,
- _1 ));
+ [this]( const UnoViewSharedPtr& sp )
+ { this->viewAdded(sp); } );
}
void WaitSymbol::setVisible( const bool bVisible )
@@ -151,11 +149,9 @@ void WaitSymbol::viewRemoved( const UnoViewSharedPtr& rView )
maViews.erase(
std::remove_if(
maViews.begin(), maViews.end(),
- boost::bind(
- std::equal_to<UnoViewSharedPtr>(),
- rView,
- // select view:
- boost::bind( o3tl::select1st<ViewsVecT::value_type>(), _1 ) ) ),
+ [&rView]
+ ( const ::std::pair< UnoViewSharedPtr, cppcanvas::CustomSpriteSharedPtr >& cp )
+ { return rView == cp.first; } ),
maViews.end() );
}
@@ -166,11 +162,9 @@ void WaitSymbol::viewChanged( const UnoViewSharedPtr& rView )
std::find_if(
maViews.begin(),
maViews.end(),
- boost::bind(
- std::equal_to<UnoViewSharedPtr>(),
- rView,
- // select view:
- boost::bind( o3tl::select1st<ViewsVecT::value_type>(), _1 ))));
+ [&rView]
+ ( const ::std::pair< UnoViewSharedPtr, cppcanvas::CustomSpriteSharedPtr >& cp )
+ { return rView == cp.first; } ) );
OSL_ASSERT( aModifiedEntry != maViews.end() );
if( aModifiedEntry == maViews.end() )
diff --git a/slideshow/source/engine/waitsymbol.hxx b/slideshow/source/engine/waitsymbol.hxx
index 3613baf24fae..a98b488229f8 100644
--- a/slideshow/source/engine/waitsymbol.hxx
+++ b/slideshow/source/engine/waitsymbol.hxx
@@ -29,7 +29,6 @@
#include "unoview.hxx"
#include <boost/shared_ptr.hpp>
-#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
#include <vector>
diff --git a/slideshow/test/testshape.cxx b/slideshow/test/testshape.cxx
index 46173d9dcc5a..a64ac20cebd2 100644
--- a/slideshow/test/testshape.cxx
+++ b/slideshow/test/testshape.cxx
@@ -33,8 +33,6 @@
#include "tests.hxx"
#include "com/sun/star/presentation/XSlideShowView.hpp"
-#include <o3tl/compat_functional.hxx>
-
#include <boost/bind.hpp>
namespace target = slideshow::internal;
@@ -130,20 +128,18 @@ private:
if( std::none_of(
maViewLayers.begin(),
maViewLayers.end(),
- boost::bind( std::equal_to< target::ViewLayerSharedPtr >(),
- boost::cref( rNewLayer ),
- boost::bind( o3tl::select1st<ViewVector::value_type>(),
- _1 ))) )
+ [&rNewLayer]
+ ( const ::std::pair< ViewVector::key_type, ViewVector::mapped_type >& cp )
+ { return cp.first == rNewLayer; } ) )
throw std::exception();
maViewLayers.erase(
std::remove_if(
maViewLayers.begin(),
maViewLayers.end(),
- boost::bind( std::equal_to< target::ViewLayerSharedPtr >(),
- boost::cref( rNewLayer ),
- boost::bind( o3tl::select1st<ViewVector::value_type>(),
- _1 ))));
+ [&rNewLayer]
+ ( const ::std::pair< ViewVector::key_type, ViewVector::mapped_type >& cp )
+ { return cp.first == rNewLayer; } ) );
return true;
}
virtual bool clearAllViewLayers()