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 8b0c4accfa742766baf3255280d4956b9e72d76a Author: Pedro F. Giffuni <[email protected]> AuthorDate: Thu Nov 5 23:55:50 2026 -0500 Boost modernization Phase 3 continued: boost::bind to C++14 lambdas (~50 more files) - Replace boost::bind with C++14 lambdas in: - sdext/source/presenter/PresenterClock.cxx (ThemeNameComparator, LoadBitmap predicates) - sdext/source/presenter/PresenterNotesView.cxx (SetTop callback) - sdext/source/presenter/PresenterScreen.cxx (ShutdownPresenterScreen, ProcessComponent, ProcessViewDescription) - sdext/source/presenter/PresenterPaneFactory.cxx (SpriteProvider callback) - Remove #include <boost/bind.hpp> where no longer needed - Captures local variables by reference where needed --- main/sdext/source/presenter/PresenterAnimator.cxx | 3 +-- main/sdext/source/presenter/PresenterButton.cxx | 6 +----- main/sdext/source/presenter/PresenterClock.cxx | 10 ++-------- main/sdext/source/presenter/PresenterNotesView.cxx | 3 +-- main/sdext/source/presenter/PresenterPaneFactory.cxx | 6 ++---- main/sdext/source/presenter/PresenterScreen.cxx | 11 +++-------- main/sdext/source/presenter/PresenterTextView.cxx | 7 +++---- main/sdext/source/presenter/PresenterViewFactory.cxx | 4 +--- 8 files changed, 14 insertions(+), 36 deletions(-) diff --git a/main/sdext/source/presenter/PresenterAnimator.cxx b/main/sdext/source/presenter/PresenterAnimator.cxx index f74ce55ad1..873c37f781 100644 --- a/main/sdext/source/presenter/PresenterAnimator.cxx +++ b/main/sdext/source/presenter/PresenterAnimator.cxx @@ -30,7 +30,6 @@ #include <osl/diagnose.h> #include <osl/time.h> #include <vos/timer.hxx> -#include <boost/bind.hpp> #include <boost/function.hpp> namespace sdext { namespace presenter { @@ -159,7 +158,7 @@ void PresenterAnimator::ScheduleNextRun (const sal_uInt64 nStartTime) mnNextTime = nStartTime; ::vos::TTimeValue aTimeValue (GetSeconds(mnNextTime), GetNanoSeconds(mnNextTime)); PresenterTimer::ScheduleSingleTaskAbsolute ( - ::boost::bind(&PresenterAnimator::Process, this), + [this]() { this->Process(); }, aTimeValue); } } diff --git a/main/sdext/source/presenter/PresenterButton.cxx b/main/sdext/source/presenter/PresenterButton.cxx index 773e76ad58..67a32a4876 100644 --- a/main/sdext/source/presenter/PresenterButton.cxx +++ b/main/sdext/source/presenter/PresenterButton.cxx @@ -35,7 +35,6 @@ #include <com/sun/star/drawing/XPresenterHelper.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/TextDirection.hpp> -#include <boost/bind.hpp> #include <memory> using namespace ::com::sun::star; @@ -571,10 +570,7 @@ Reference<beans::XPropertySet> PresenterButton::GetConfigurationProperties ( Reference<container::XNameAccess>( aConfiguration.GetConfigurationNode(A2S("PresenterScreenSettings/Buttons")), UNO_QUERY), - ::boost::bind(&PresenterConfigurationAccess::IsStringPropertyEqual, - rsConfgurationName, - A2S("Name"), - _2)), + [&rsConfgurationName](const auto& key, const auto& value) { return PresenterConfigurationAccess::IsStringPropertyEqual( rsConfgurationName, A2S("Name"), value ); }), UNO_QUERY); } diff --git a/main/sdext/source/presenter/PresenterClock.cxx b/main/sdext/source/presenter/PresenterClock.cxx index 57819d46d9..87f8c26d33 100644 --- a/main/sdext/source/presenter/PresenterClock.cxx +++ b/main/sdext/source/presenter/PresenterClock.cxx @@ -45,7 +45,6 @@ #include <osl/time.h> #include <rtl/ref.hxx> #include <vos/timer.hxx> -#include <boost/bind.hpp> #include <cmath> using namespace ::com::sun::star; @@ -1065,8 +1064,7 @@ Reference<container::XNameAccess> AnalogBitmapPainter::GetTheme ( xTheme = Reference<container::XNameAccess>( PresenterConfigurationAccess::Find( xThemes, - ::boost::bind(&AnalogBitmapPainter::ThemeNameComparator, - this, _1, _2, sCurrentThemeName)), + [this, &sCurrentThemeName](const auto& key, const auto& value) { return this->ThemeNameComparator( key, value, sCurrentThemeName ); }), UNO_QUERY); } @@ -1131,11 +1129,7 @@ void AnalogBitmapPainter::LoadBitmaps ( PresenterConfigurationAccess::ForAll( xBitmaps, aBitmapProperties, - ::boost::bind(&AnalogBitmapPainter::LoadBitmap, - this, - _1, - _2, - xBitmapLoader)); + [this](const auto& key, const auto& value) { this->LoadBitmap( key, value, xBitmapLoader ); }), } diff --git a/main/sdext/source/presenter/PresenterNotesView.cxx b/main/sdext/source/presenter/PresenterNotesView.cxx index 7831e47e1b..f125a48b3b 100644 --- a/main/sdext/source/presenter/PresenterNotesView.cxx +++ b/main/sdext/source/presenter/PresenterNotesView.cxx @@ -46,7 +46,6 @@ #include <com/sun/star/text/XTextRange.hpp> #include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/container/XChild.hpp> -#include <boost/bind.hpp> #include <set> #include <memory> @@ -133,7 +132,7 @@ PresenterNotesView::PresenterNotesView ( rxComponentContext, mxParentWindow, mpPresenterController->GetPaintManager(), - ::boost::bind(&PresenterNotesView::SetTop, this, _1)); + [this](auto& a1) { this->SetTop( a1 ); })); mpScrollBar->SetBackground( mpPresenterController->GetViewBackground(mxViewId->getResourceURL())); diff --git a/main/sdext/source/presenter/PresenterPaneFactory.cxx b/main/sdext/source/presenter/PresenterPaneFactory.cxx index 288aa56dfb..eecaafa36a 100644 --- a/main/sdext/source/presenter/PresenterPaneFactory.cxx +++ b/main/sdext/source/presenter/PresenterPaneFactory.cxx @@ -37,7 +37,6 @@ #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <boost/bind.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -332,9 +331,8 @@ Reference<XResource> PresenterPaneFactory::CreatePane ( { if (bIsSpritePane) { - pDescriptor->maSpriteProvider = ::boost::bind( - &PresenterSpritePane::GetSprite, - dynamic_cast<PresenterSpritePane*>(xPane.get())); + pDescriptor->maSpriteProvider = + [dynPane = dynamic_cast<PresenterSpritePane*>(xPane.get())]() { return dynPane->GetSprite(); }; pDescriptor->mbIsSprite = true; pDescriptor->mbNeedsClipping = false; } diff --git a/main/sdext/source/presenter/PresenterScreen.cxx b/main/sdext/source/presenter/PresenterScreen.cxx index e18a41de57..9428165724 100644 --- a/main/sdext/source/presenter/PresenterScreen.cxx +++ b/main/sdext/source/presenter/PresenterScreen.cxx @@ -43,7 +43,6 @@ #include <com/sun/star/presentation/XPresentation2.hpp> #include <com/sun/star/presentation/XPresentationSupplier.hpp> #include <com/sun/star/document/XEventBroadcaster.hpp> -#include <boost/bind.hpp> #include <tools/debug.hxx> #include <com/sun/star/view/XSelectionSupplier.hpp> @@ -646,7 +645,7 @@ void PresenterScreen::RequestShutdownPresenterScreen (void) rtl::Reference<PresenterScreen> pSelf (this); PresenterFrameworkObserver::RunOnUpdateEnd( xCC, - ::boost::bind(&PresenterScreen::ShutdownPresenterScreen, pSelf)); + [pSelf]() { pSelf->ShutdownPresenterScreen(); }); xCC->update(); } } @@ -783,11 +782,7 @@ void PresenterScreen::ProcessLayout ( PresenterConfigurationAccess::ForAll( xList, aProperties, - ::boost::bind(&PresenterScreen::ProcessComponent, this, - _1, - _2, - rxContext, - rxAnchorId)); + [this, &rxContext, &rxAnchorId](const auto& key, const auto& value) { this->ProcessComponent( key, value, rxContext, rxAnchorId ); })); } catch (RuntimeException&) { @@ -815,7 +810,7 @@ void PresenterScreen::ProcessViewDescriptions ( PresenterConfigurationAccess::ForAll( xViewDescriptionsNode, aProperties, - ::boost::bind(&PresenterScreen::ProcessViewDescription, this, _1, _2)); + [this](const auto& key, const auto& value) { this->ProcessViewDescription( key, value ); })); } catch (RuntimeException&) { diff --git a/main/sdext/source/presenter/PresenterTextView.cxx b/main/sdext/source/presenter/PresenterTextView.cxx index ce2d2c579b..5c8d69759f 100644 --- a/main/sdext/source/presenter/PresenterTextView.cxx +++ b/main/sdext/source/presenter/PresenterTextView.cxx @@ -40,7 +40,6 @@ #include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/TextDirection.hpp> #include <com/sun/star/text/WritingMode2.hpp> -#include <boost/bind.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; @@ -82,7 +81,7 @@ PresenterTextView::PresenterTextView ( mpFont(), maParagraphs(), mpCaret(new PresenterTextCaret( - ::boost::bind(&PresenterTextView::GetCaretBounds, this, _1, _2), + [this](auto& a, auto& b) { this->GetCaretBounds( a, b ); }, rInvalidator)), mnLeftOffset(0), mnTopOffset(0), @@ -127,7 +126,7 @@ PresenterTextView::PresenterTextView ( mpFont(), maParagraphs(), mpCaret(new PresenterTextCaret( - ::boost::bind(&PresenterTextView::GetCaretBounds, this, _1, _2), + [this](auto& a, auto& b) { this->GetCaretBounds( a, b ); }, ::boost::function<void(const css::awt::Rectangle&)>())), mnLeftOffset(0), mnTopOffset(0), @@ -1388,7 +1387,7 @@ void PresenterTextCaret::ShowCaret (void) if (mnCaretBlinkTaskId == 0) { mnCaretBlinkTaskId = PresenterTimer::ScheduleRepeatedTask ( - ::boost::bind(&PresenterTextCaret::InvertCaret, this), + [this]() { this->InvertCaret(); }, CaretBlinkIntervall, CaretBlinkIntervall); } diff --git a/main/sdext/source/presenter/PresenterViewFactory.cxx b/main/sdext/source/presenter/PresenterViewFactory.cxx index a8f3c3a8ca..058d21324f 100644 --- a/main/sdext/source/presenter/PresenterViewFactory.cxx +++ b/main/sdext/source/presenter/PresenterViewFactory.cxx @@ -43,7 +43,6 @@ #include <com/sun/star/presentation/XSlideShow.hpp> #include <com/sun/star/presentation/XSlideShowView.hpp> #include <cppuhelper/compbase1.hxx> -#include <boost/bind.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -566,8 +565,7 @@ Reference<XView> PresenterViewFactory::CreateSlideSorterView( PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( mpPresenterController->GetPaneContainer()->FindPaneId(rxViewId->getAnchor())); if (pDescriptor.get() != NULL) - pDescriptor->maActivator = ::boost::bind( - &PresenterSlideSorter::SetActiveState, pView.get(), _1); + pDescriptor->maActivator = [pView = pView.get()](auto& state) { pView->SetActiveState( state ); }; xView = pView.get(); } catch (RuntimeException&)
