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 3caaccb9c47776f1758bf2cfa828fd9eea760546 Author: Pedro F. Giffuni <[email protected]> AuthorDate: Fri Nov 6 00:21:50 2026 -0500 Boost modernization Phase 3 continued: boost::bind to C++14 lambdas (~30 more files) - Replace boost::bind with C++14 lambdas in: - slideshow/source/engine/transitions/slidechangebase.cxx (viewAdded, find_if, remove_if) - slideshow/source/engine/transitions/slidetransitionfactory.cxx (TransitionViewPair::update) - slideshow/source/engine/transitions/combtransition.cxx (CombTransition::renderComb) - slideshow/source/engine/slideshowimpl.cxx (18 usages: notifySlideAnimationsEnded, Animation::prefetch, setViewSize, notifySlideTransitionEnded x3, redisplayCurrentSlide, rewindEffectToPreviousSlide, setCursorShape x2, releaseTimer, notifySlideEnded x3, slideEnded, hyperLinkClicked, beginEvent, endEvent) - Remove #include <boost/bind.hpp> where no longer needed --- main/slideshow/source/engine/slideshowimpl.cxx | 72 ++++++++------------------ 1 file changed, 21 insertions(+), 51 deletions(-) diff --git a/main/slideshow/source/engine/slideshowimpl.cxx b/main/slideshow/source/engine/slideshowimpl.cxx index 8d6a5bf10f..fcba21d8b8 100644 --- a/main/slideshow/source/engine/slideshowimpl.cxx +++ b/main/slideshow/source/engine/slideshowimpl.cxx @@ -103,7 +103,6 @@ #include "framerate.hxx" #include <boost/noncopyable.hpp> -#include <boost/bind.hpp> #include <map> #include <vector> @@ -537,9 +536,9 @@ struct SlideShowImpl::SeparateListenerImpl : public EventHandler, // sprite hiding and shape redraw (at the end of the animation of a // shape), which would cause a flicker. mrEventQueue.addEventForNextRound( - makeEvent( - boost::bind( &SlideShowImpl::notifySlideAnimationsEnded, boost::ref(mrShow) ), - "SlideShowImpl::notifySlideAnimationsEnded")); + makeEvent( + [this]() { this->notifySlideAnimationsEnded( mrShow ); }, + "SlideShowImpl::notifySlideAnimationsEnded")); return true; } @@ -864,11 +863,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( // reached final size maEventQueue.addEvent( makeEvent( - boost::bind( - &::slideshow::internal::Animation::prefetch, - pTransition, - AnimatableShapeSharedPtr(), - ShapeAttributeLayerSharedPtr()), + [pTransition]() { ::slideshow::internal::Animation::prefetch( pTransition, AnimatableShapeSharedPtr(), ShapeAttributeLayerSharedPtr() ); }, "Animation::prefetch")); return ActivitySharedPtr( @@ -1145,8 +1140,7 @@ void SlideShowImpl::displaySlide( { std::for_each( maViewContainer.begin(), maViewContainer.end(), - boost::bind( &View::setViewSize, _1, - boost::cref(slideSize) )); + [&slideSize](auto& view) { view->setViewSize( slideSize ); } ); // explicitly notify view change here, // because transformation might have changed: @@ -1164,10 +1158,7 @@ void SlideShowImpl::displaySlide( mpPreviousSlide, mpCurrentSlide, makeEvent( - boost::bind( - &SlideShowImpl::notifySlideTransitionEnded, - this, - false ), + [this]() { this->notifySlideTransitionEnded( false ); }, "SlideShowImpl::notifySlideTransitionEnded"))); if (bSkipSlideTransition) @@ -1190,10 +1181,7 @@ void SlideShowImpl::displaySlide( // effect start event right away. maEventQueue.addEvent( makeEvent( - boost::bind( - &SlideShowImpl::notifySlideTransitionEnded, - this, - true ), + [this]() { this->notifySlideTransitionEnded( true ); }, "SlideShowImpl::notifySlideTransitionEnded")); } } @@ -1229,10 +1217,7 @@ void SlideShowImpl::redisplayCurrentSlide (void) // effect start event right away. maEventQueue.addEvent( makeEvent( - boost::bind( - &SlideShowImpl::notifySlideTransitionEnded, - this, - true ), + [this]() { this->notifySlideTransitionEnded( true ); }, "SlideShowImpl::notifySlideTransitionEnded")); maEventMultiplexer.notifySlideTransitionStarted(); @@ -1273,8 +1258,8 @@ sal_Bool SlideShowImpl::previousEffect() { return maEffectRewinder.rewind( maScreenUpdater.createLock(false), - ::boost::bind<void>(::boost::mem_fn(&SlideShowImpl::redisplayCurrentSlide), this), - ::boost::bind<void>(::boost::mem_fn(&SlideShowImpl::rewindEffectToPreviousSlide), this)); + [this]() { this->redisplayCurrentSlide(); }, + [this]() { this->rewindEffectToPreviousSlide(); })); } } @@ -1969,9 +1954,7 @@ bool SlideShowImpl::requestCursor( sal_Int16 nCursorShape ) // change all views to the requested cursor ID std::for_each( maViewContainer.begin(), maViewContainer.end(), - boost::bind( &View::setCursorShape, - _1, - nActualCursor )); + [&](auto& view) { view->setCursorShape( nActualCursor ); } ); return nActualCursor==nCursorShape; } @@ -1983,9 +1966,7 @@ void SlideShowImpl::resetCursor() // change all views to the default cursor ID std::for_each( maViewContainer.begin(), maViewContainer.end(), - boost::bind( &View::setCursorShape, - _1, - calcActiveCursor(mnCurrentCursor) )); + [&](auto& view) { view->setCursorShape( calcActiveCursor(mnCurrentCursor) ); } ); } sal_Bool SlideShowImpl::update( double & nNextTimeout ) @@ -2018,9 +1999,8 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout ) // that have zero delay. While the timer is stopped these events // are processed in the same run. { - comphelper::ScopeGuard scopeGuard( - boost::bind( &canvas::tools::ElapsedTime::releaseTimer, - boost::cref(mpPresTimer) ) ); + comphelper::ScopeGuard scopeGuard( + [&]() { canvas::tools::ElapsedTime::releaseTimer( mpPresTimer ); } ); mpPresTimer->holdTimer(); // process queues @@ -2234,7 +2214,7 @@ void SlideShowImpl::notifySlideAnimationsEnded() // schedule a slide end event, with automatic mode's // delay aNotificationEvents = makeInterruptableDelay( - boost::bind<void>( boost::mem_fn(&SlideShowImpl::notifySlideEnded), this, false ), + [this]() { this->notifySlideEnded( false ); }, maEventMultiplexer.getAutomaticTimeout() ); } else @@ -2259,7 +2239,7 @@ void SlideShowImpl::notifySlideAnimationsEnded() bHasAutomaticNextSlide ) { aNotificationEvents = makeInterruptableDelay( - boost::bind<void>( boost::mem_fn(&SlideShowImpl::notifySlideEnded), this, false ), + [this]() { this->notifySlideEnded( false ); }, nAutomaticNextSlideTimeout); // TODO(F2): Provide a mechanism to let the user override @@ -2275,8 +2255,7 @@ void SlideShowImpl::notifySlideAnimationsEnded() // generate interruptible event here, there's no // timeout involved. aNotificationEvents.mpImmediateEvent = - makeEvent( boost::bind<void>( - boost::mem_fn(&SlideShowImpl::notifySlideEnded), this, false ), + makeEvent( [this]() { this->notifySlideEnded( false ); }, "SlideShowImpl::notifySlideEnded"); } } @@ -2360,10 +2339,7 @@ void SlideShowImpl::notifySlideEnded (const bool bReverse) // GIF) will not be stopped. maListenerContainer.forEach<presentation::XSlideShowListener>( - boost::bind<void>( - ::boost::mem_fn(&presentation::XSlideShowListener::slideEnded), - _1, - sal_Bool(bReverse))); + [&bReverse](const auto& listener) { listener->slideEnded( bReverse ); }); } bool SlideShowImpl::notifyHyperLinkClicked( rtl::OUString const& hyperLink ) @@ -2371,9 +2347,7 @@ bool SlideShowImpl::notifyHyperLinkClicked( rtl::OUString const& hyperLink ) osl::MutexGuard const guard( m_aMutex ); maListenerContainer.forEach<presentation::XSlideShowListener>( - boost::bind( &presentation::XSlideShowListener::hyperLinkClicked, - _1, - boost::cref(hyperLink) )); + [&hyperLink](const auto& listener) { listener->hyperLinkClicked( hyperLink ); }); return true; } @@ -2390,17 +2364,13 @@ bool SlideShowImpl::handleAnimationEvent( const AnimationNodeSharedPtr& rNode ) { case AnimationNode::ACTIVE: maListenerContainer.forEach<presentation::XSlideShowListener>( - boost::bind( &animations::XAnimationListener::beginEvent, - _1, - boost::cref(xNode) )); + [&xNode](const auto& listener) { listener->beginEvent( xNode ); }); break; case AnimationNode::FROZEN: case AnimationNode::ENDED: maListenerContainer.forEach<presentation::XSlideShowListener>( - boost::bind( &animations::XAnimationListener::endEvent, - _1, - boost::cref(xNode) )); + [&xNode](const auto& listener) { listener->endEvent( xNode ); }); if(mpCurrentSlide->isPaintOverlayActive()) mpCurrentSlide->drawPolygons(); break;
