[Libreoffice-commits] core.git: slideshow/inc slideshow/source slideshow/test
Daniel Robertson
danlrobertson89 at gmail.com
Sat Aug 8 05:28:17 PDT 2015
slideshow/inc/pch/precompiled_slideshow.hxx | 1
slideshow/source/engine/pointersymbol.cxx | 23 ++++++--------------
slideshow/source/engine/pointersymbol.hxx | 1
slideshow/source/engine/rehearsetimingsactivity.cxx | 21 ++++++------------
slideshow/source/engine/slide/layermanager.cxx | 15 +++++--------
slideshow/source/engine/slide/shapemanagerimpl.cxx | 22 +++++--------------
slideshow/source/engine/slide/slideimpl.cxx | 23 ++++++--------------
slideshow/source/engine/waitsymbol.cxx | 22 ++++++-------------
slideshow/source/engine/waitsymbol.hxx | 1
slideshow/test/testshape.cxx | 16 +++++--------
10 files changed, 49 insertions(+), 96 deletions(-)
New commits:
commit 717b23ef2765678a5598d652956edd77d2d62fc5
Author: Daniel Robertson <danlrobertson89 at gmail.com>
Date: Sat Aug 1 11:27:08 2015 -0400
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 at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/slideshow/inc/pch/precompiled_slideshow.hxx b/slideshow/inc/pch/precompiled_slideshow.hxx
index 96a8bb9..e41362e 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 20dd121..eed4056 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 4d9a89d..8a7517f 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 a0c271d..966bfc3 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 7e02799..6a1f924 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 c952825..3ec7a9c1 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 0791393..3d3c404 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 2017d74..9d5f285 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 3613baf..a98b488 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 46173d9..a64ac20 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()
More information about the Libreoffice-commits
mailing list