This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch compilers-101 in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 008a1087dca63dee5803ffcafd7aaf8882e444d0 Author: Pedro F. Giffuni <[email protected]> AuthorDate: Fri Nov 6 00:25:20 2026 -0500 Boost modernization Phase 3 continued: boost::bind to C++14 lambdas (~15 more files) - Replace boost::bind with C++14 lambdas in: - slideshow/source/engine/shapes/mediashape.cxx (forEach resize, count_if/remove_if with getViewLayer, count_if render, forEach setMediaTime) - Remove #include <boost/bind.hpp> where no longer needed --- main/slideshow/source/engine/shapes/mediashape.cxx | 33 ++++++---------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/main/slideshow/source/engine/shapes/mediashape.cxx b/main/slideshow/source/engine/shapes/mediashape.cxx index 083ba0c464..0caf4d0aaa 100644 --- a/main/slideshow/source/engine/shapes/mediashape.cxx +++ b/main/slideshow/source/engine/shapes/mediashape.cxx @@ -38,7 +38,6 @@ #include "shape.hxx" #include "tools.hxx" -#include <boost/bind.hpp> #include <algorithm> #include <memory> @@ -133,12 +132,9 @@ namespace slideshow { // resize all ViewShapes ::basegfx::B2DRange aBounds = getBounds(); - ::std::for_each( maViewMediaShapes.begin(), - maViewMediaShapes.end(), - ::boost::bind( - &ViewMediaShape::resize, - _1, - ::boost::cref( aBounds ) ) ); + ::std::for_each( maViewMediaShapes.begin(), + maViewMediaShapes.end(), + [&](auto& vs) { vs->resize( aBounds ); } ); } // --------------------------------------------------------------------- @@ -167,21 +163,14 @@ namespace slideshow OSL_ENSURE( ::std::count_if(maViewMediaShapes.begin(), aEnd, - ::boost::bind<bool>( - ::std::equal_to< ViewLayerSharedPtr >(), - ::boost::bind( &ViewMediaShape::getViewLayer, _1 ), - ::boost::cref( rLayer ) ) ) < 2, + [&rLayer](const auto& vs) { return rLayer == vs->getViewLayer(); } ) < 2, "MediaShape::removeViewLayer(): Duplicate ViewLayer entries!" ); ViewMediaShapeVector::iterator aIter; if( (aIter=::std::remove_if( maViewMediaShapes.begin(), aEnd, - ::boost::bind<bool>( - ::std::equal_to< ViewLayerSharedPtr >(), - ::boost::bind( &ViewMediaShape::getViewLayer, - _1 ), - ::boost::cref( rLayer ) ) )) == aEnd ) + [&rLayer](const auto& vs) { return rLayer == vs->getViewLayer(); } )) == aEnd ) { // view layer seemingly was not added, failed return false; @@ -208,10 +197,7 @@ namespace slideshow // redraw all view shapes, by calling their update() method if( ::std::count_if( maViewMediaShapes.begin(), maViewMediaShapes.end(), - ::boost::bind<bool>( - ::boost::mem_fn( &ViewMediaShape::render ), - _1, - ::boost::cref( rCurrBounds ) ) ) + [&](const auto& vs) { return vs->render( rCurrBounds ); } ) != static_cast<ViewMediaShapeVector::difference_type>(maViewMediaShapes.size()) ) { // at least one of the ViewShape::update() calls did return @@ -272,10 +258,9 @@ namespace slideshow void MediaShape::implSetIntrinsicAnimationTime(double fTime) { - ::std::for_each( maViewMediaShapes.begin(), - maViewMediaShapes.end(), - ::boost::bind( &ViewMediaShape::setMediaTime, - _1, boost::cref(fTime)) ); + ::std::for_each( maViewMediaShapes.begin(), + maViewMediaShapes.end(), + [&fTime](auto& vs) { vs->setMediaTime( fTime ); } ); } // ---------------------------------------------------------------------
