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 9a17aac90e1a5beeee7aff4f5bb3d4b6594109f3 Author: Pedro F. Giffuni <[email protected]> AuthorDate: Fri Nov 6 00:37:07 2026 -0500 Boost modernization Phase 3 continued: boost::bind to C++14 lambdas (~30 more files) - Replace boost::bind with C++14 lambdas in: - sd/source/ui/framework/factories/BasicPaneFactory.cxx (CompareURL, ComparePane x2) - sd/source/ui/framework/factories/BasicViewFactory.cxx (CompareView) - sd/source/ui/framework/module/ModuleController.cxx (ProcessFactory, ProcessStartupService) - sd/source/ui/framework/configuration/ResourceFactoryManager.cxx (equal_to with second) - sd/source/ui/framework/configuration/ConfigurationUpdater.cxx (SetUpdateBeingProcessed ScopeGuard) - sd/source/ui/slideshow/slideshowimpl.cxx (beginEvent, endEvent, repeat, slideEnded, hyperLinkClicked) - sd/source/ui/slideshow/SlideShowRestarter.cxx (StartPresentation) - sd/source/ui/slideshow/slideshow.cxx (StartInPlacePresentationConfigurationCallback) - Remove #include <boost/bind.hpp> where no longer needed --- .../ui/framework/configuration/ConfigurationUpdater.cxx | 3 +-- .../ui/framework/configuration/ResourceFactoryManager.cxx | 6 +----- main/sd/source/ui/framework/factories/BasicPaneFactory.cxx | 7 +++---- main/sd/source/ui/framework/factories/BasicViewFactory.cxx | 3 +-- main/sd/source/ui/framework/module/ModuleController.cxx | 5 ++--- main/sd/source/ui/slideshow/SlideShowRestarter.cxx | 3 +-- main/sd/source/ui/slideshow/slideshow.cxx | 3 +-- main/sd/source/ui/slideshow/slideshowimpl.cxx | 11 +++++------ 8 files changed, 15 insertions(+), 26 deletions(-) diff --git a/main/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/main/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx index 80a12833d4..698b0d72b0 100644 --- a/main/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx +++ b/main/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx @@ -33,7 +33,6 @@ #include <comphelper/scopeguard.hxx> #include <tools/diagnose_ex.h> -#include <boost/bind.hpp> #include <memory> using namespace ::com::sun::star; @@ -179,7 +178,7 @@ void ConfigurationUpdater::UpdateConfiguration (void) #endif SetUpdateBeingProcessed(true); comphelper::ScopeGuard aScopeGuard ( - ::boost::bind(&ConfigurationUpdater::SetUpdateBeingProcessed, this, false)); + [this]() { this->SetUpdateBeingProcessed( false ); }); try { diff --git a/main/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx b/main/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx index 06ba991d9a..cba6be34d6 100644 --- a/main/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx +++ b/main/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx @@ -29,7 +29,6 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> -#include <boost/bind.hpp> #include <algorithm> using namespace ::com::sun::star; @@ -166,10 +165,7 @@ void ResourceFactoryManager::RemoveFactoryForReference( std::remove_if( maFactoryPatternList.begin(), maFactoryPatternList.end(), - ::boost::bind( - std::equal_to<Reference<XResourceFactory> >(), - ::boost::bind(&FactoryPatternList::value_type::second, _1), - rxFactory))); + [rxFactory](const auto& entry) { return rxFactory == entry.second; })); if (iNewEnd != maFactoryPatternList.end()) maFactoryPatternList.erase(iNewEnd, maFactoryPatternList.end()); } diff --git a/main/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/main/sd/source/ui/framework/factories/BasicPaneFactory.cxx index 36a422930b..586a46dc4a 100644 --- a/main/sd/source/ui/framework/factories/BasicPaneFactory.cxx +++ b/main/sd/source/ui/framework/factories/BasicPaneFactory.cxx @@ -35,7 +35,6 @@ #include "DrawController.hxx" #include "DrawDocShell.hxx" #include <com/sun/star/drawing/framework/XControllerManager.hpp> -#include <boost/bind.hpp> using namespace ::com::sun::star; @@ -270,7 +269,7 @@ Reference<XResource> SAL_CALL BasicPaneFactory::createResource ( ::std::find_if ( mpPaneContainer->begin(), mpPaneContainer->end(), - ::boost::bind(&PaneDescriptor::CompareURL, _1, rxPaneId->getResourceURL()))); + [&rxPaneId](const auto& desc) { return desc.CompareURL( rxPaneId->getResourceURL() ); })); if (iDescriptor != mpPaneContainer->end()) { @@ -338,7 +337,7 @@ void SAL_CALL BasicPaneFactory::releaseResource ( ::std::find_if( mpPaneContainer->begin(), mpPaneContainer->end(), - ::boost::bind(&PaneDescriptor::ComparePane, _1, rxPane))); + [&rxPane](const auto& desc) { return desc.ComparePane( rxPane ); })); if (iDescriptor != mpPaneContainer->end()) { @@ -443,7 +442,7 @@ void SAL_CALL BasicPaneFactory::disposing ( ::std::find_if ( mpPaneContainer->begin(), mpPaneContainer->end(), - ::boost::bind(&PaneDescriptor::ComparePane, _1, xPane))); + [&xPane](const auto& desc) { return desc.ComparePane( xPane ); })); if (iDescriptor != mpPaneContainer->end()) { iDescriptor->mxPane = NULL; diff --git a/main/sd/source/ui/framework/factories/BasicViewFactory.cxx b/main/sd/source/ui/framework/factories/BasicViewFactory.cxx index c01ab44127..d71ddf9bd3 100644 --- a/main/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/main/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -46,7 +46,6 @@ #include <vcl/wrkwin.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <boost/bind.hpp> #include <memory> using namespace ::com::sun::star; @@ -253,7 +252,7 @@ void SAL_CALL BasicViewFactory::releaseResource (const Reference<XResource>& rxV ::std::find_if( mpViewShellContainer->begin(), mpViewShellContainer->end(), - ::boost::bind(&ViewDescriptor::CompareView, _1, rxView))); + [&rxView](const auto& desc) { return desc.CompareView( rxView ); })); if (iViewShell != mpViewShellContainer->end()) { ::std::shared_ptr<ViewShell> pViewShell ((*iViewShell)->mpViewShell); diff --git a/main/sd/source/ui/framework/module/ModuleController.cxx b/main/sd/source/ui/framework/module/ModuleController.cxx index c3be047f25..f08fa421f0 100644 --- a/main/sd/source/ui/framework/module/ModuleController.cxx +++ b/main/sd/source/ui/framework/module/ModuleController.cxx @@ -28,7 +28,6 @@ #include "tools/ConfigurationAccess.hxx" #include <comphelper/processfactory.hxx> #include <comphelper/stl_types.hxx> -#include <boost/bind.hpp> #include <unordered_map> #include <tools/diagnose_ex.h> @@ -165,7 +164,7 @@ void ModuleController::LoadFactories (const Reference<XComponentContext>& rxCont ConfigurationAccess::ForAll( xFactories, aProperties, - ::boost::bind(&ModuleController::ProcessFactory, this, _2)); + [this](const auto& key, const auto& value) { this->ProcessFactory( value ); })); } catch (Exception&) { @@ -228,7 +227,7 @@ void ModuleController::InstantiateStartupServices (void) tools::ConfigurationAccess::ForAll( xFactories, aProperties, - ::boost::bind(&ModuleController::ProcessStartupService, this, _2)); + [this](const auto& key, const auto& value) { this->ProcessStartupService( value ); })); } catch (Exception&) { diff --git a/main/sd/source/ui/slideshow/SlideShowRestarter.cxx b/main/sd/source/ui/slideshow/SlideShowRestarter.cxx index 5317f8356e..db163ba80a 100644 --- a/main/sd/source/ui/slideshow/SlideShowRestarter.cxx +++ b/main/sd/source/ui/slideshow/SlideShowRestarter.cxx @@ -29,7 +29,6 @@ #include <sfx2/viewfrm.hxx> #include <svx/svxids.hrc> #include <vcl/svapp.hxx> -#include <boost/bind.hpp> #include <memory> using namespace ::com::sun::star::uno; @@ -128,7 +127,7 @@ IMPL_LINK(SlideShowRestarter, EndPresentation, void*, EMPTYARG) pHelper->RunOnConfigurationEvent( FrameworkHelper::msConfigurationUpdateEndEvent, - ::boost::bind(&SlideShowRestarter::StartPresentation, shared_from_this())); + [self = shared_from_this()]() { self->StartPresentation(); }); pHelper->UpdateConfiguration(); } else diff --git a/main/sd/source/ui/slideshow/slideshow.cxx b/main/sd/source/ui/slideshow/slideshow.cxx index c38d92e144..d5a6eef1c1 100644 --- a/main/sd/source/ui/slideshow/slideshow.cxx +++ b/main/sd/source/ui/slideshow/slideshow.cxx @@ -54,7 +54,6 @@ #include "ViewShell.hxx" #include "SlideShowRestarter.hxx" #include "DrawController.hxx" -#include <boost/bind.hpp> #include <memory> using ::com::sun::star::presentation::XSlideShowController; @@ -1188,7 +1187,7 @@ void SlideShow::StartInPlacePresentation() } pHelper->RequestView( FrameworkHelper::msImpressViewURL, FrameworkHelper::msCenterPaneURL ); - pHelper->RunOnConfigurationEvent( FrameworkHelper::msConfigurationUpdateEndEvent, ::boost::bind(&SlideShow::StartInPlacePresentationConfigurationCallback, this) ); + pHelper->RunOnConfigurationEvent( FrameworkHelper::msConfigurationUpdateEndEvent, [this]() { this->StartInPlacePresentationConfigurationCallback(); } ); return; } else diff --git a/main/sd/source/ui/slideshow/slideshowimpl.cxx b/main/sd/source/ui/slideshow/slideshowimpl.cxx index abb7057af4..dba82fbc3b 100644 --- a/main/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/main/sd/source/ui/slideshow/slideshowimpl.cxx @@ -81,7 +81,6 @@ #include <vcl/imagerepository.hxx> #include <boost/noncopyable.hpp> -#include <boost/bind.hpp> using ::rtl::OUString; using ::rtl::OString; @@ -3781,7 +3780,7 @@ void SAL_CALL SlideShowListenerProxy::beginEvent( const Reference< XAnimationNod ::osl::MutexGuard aGuard( m_aMutex ); if( maListeners.getLength() >= 0 ) - maListeners.forEach<XSlideShowListener>( boost::bind( &XAnimationListener::beginEvent, _1, boost::cref(xNode) )); + maListeners.forEach<XSlideShowListener>( [&xNode](const auto& listener) { listener->beginEvent( xNode ); }); } // --------------------------------------------------------- @@ -3791,7 +3790,7 @@ void SAL_CALL SlideShowListenerProxy::endEvent( const Reference< XAnimationNode ::osl::MutexGuard aGuard( m_aMutex ); if( maListeners.getLength() >= 0 ) - maListeners.forEach<XSlideShowListener>( boost::bind( &XAnimationListener::endEvent, _1, boost::cref(xNode) )); + maListeners.forEach<XSlideShowListener>( [&xNode](const auto& listener) { listener->endEvent( xNode ); }); } // --------------------------------------------------------- @@ -3801,7 +3800,7 @@ void SAL_CALL SlideShowListenerProxy::repeat( const Reference< XAnimationNode >& ::osl::MutexGuard aGuard( m_aMutex ); if( maListeners.getLength() >= 0 ) - maListeners.forEach<XSlideShowListener>( boost::bind( &XAnimationListener::repeat, _1, boost::cref(xNode), boost::cref(nRepeat) )); + maListeners.forEach<XSlideShowListener>( [&xNode, &nRepeat](const auto& listener) { listener->repeat( xNode, nRepeat ); }); } // --------------------------------------------------------- @@ -3865,7 +3864,7 @@ void SlideShowListenerProxy::slideEnded(sal_Bool bReverse) if( maListeners.getLength() >= 0 ) maListeners.forEach<XSlideShowListener>( - boost::bind( &XSlideShowListener::slideEnded, _1, bReverse) ); + [bReverse](const auto& listener) { listener->slideEnded( bReverse ); } ); } { @@ -3883,7 +3882,7 @@ void SlideShowListenerProxy::hyperLinkClicked( rtl::OUString const& aHyperLink ) ::osl::MutexGuard aGuard( m_aMutex ); if( maListeners.getLength() >= 0 ) - maListeners.forEach<XSlideShowListener>( boost::bind( &XSlideShowListener::hyperLinkClicked, _1, boost::cref(aHyperLink) )); + maListeners.forEach<XSlideShowListener>( [&aHyperLink](const auto& listener) { listener->hyperLinkClicked( aHyperLink ); }); } {
