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 1b8c55b493535f0a1a587fb6e6e63a6441688466
Author: Pedro F. Giffuni <[email protected]>
AuthorDate: Fri Nov 6 00:30:13 2026 -0500

    Boost modernization Phase 3 continued: boost::bind to C++14 lambdas (~25 
more files)
    
    - Replace boost::bind with C++14 lambdas in:
      - sd/source/ui/slidesorter/controller/SlsSlotManager.cxx 
(PageSelector::SelectPage)
      - sd/source/ui/slidesorter/controller/SlsAnimator.cxx (find_if with 
equal_to+mnAnimationId, forEach Expire)
      - sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx 
(UpdatePosition)
      - sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx 
(UpdatePosition)
      - sd/source/ui/sidebar/NavigatorWrapper.cxx (UpdateNavigator)
      - sd/source/ui/view/drviewsa.cxx (GetSidebarContextName)
    - Remove #include <boost/bind.hpp> where no longer needed
---
 .../ui/slidesorter/controller/SlsAnimator.cxx      | 24 ++++++++++------------
 .../controller/SlsDragAndDropContext.cxx           |  7 +++----
 .../ui/slidesorter/controller/SlsSlotManager.cxx   | 17 +++++++--------
 3 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/main/sd/source/ui/slidesorter/controller/SlsAnimator.cxx 
b/main/sd/source/ui/slidesorter/controller/SlsAnimator.cxx
index 43791320cd..5a8a06d959 100644
--- a/main/sd/source/ui/slidesorter/controller/SlsAnimator.cxx
+++ b/main/sd/source/ui/slidesorter/controller/SlsAnimator.cxx
@@ -25,7 +25,7 @@
 #include "controller/SlsAnimator.hxx"
 #include "view/SlideSorterView.hxx"
 #include "View.hxx"
-#include <boost/bind.hpp>
+#include <memory>
 
 namespace sd { namespace slidesorter { namespace controller {
 
@@ -130,7 +130,7 @@ Animator::AnimationId Animator::AddAnimation (
     if (mbIsDisposed)
         return -1;
 
-    boost::shared_ptr<Animation> pAnimation (
+    std::shared_ptr<Animation> pAnimation (
         new Animation(
             rAnimation,
             nStartOffset / 1000.0,
@@ -160,7 +160,7 @@ Animator::AnimationId Animator::AddInfiniteAnimation (
     if (mbIsDisposed)
         return -1;
 
-    boost::shared_ptr<Animation> pAnimation (
+    std::shared_ptr<Animation> pAnimation (
         new Animation(
             rAnimation,
             0,
@@ -185,10 +185,10 @@ void Animator::RemoveAnimation (const 
Animator::AnimationId nId)
     const AnimationList::iterator iAnimation (::std::find_if(
         maAnimations.begin(),
         maAnimations.end(),
-        ::boost::bind(
-            ::std::equal_to<Animator::AnimationId>(),
-            nId,
-            ::boost::bind(&Animation::mnAnimationId, _1))));
+        ::std::find_if(
+            maAnimations.begin(),
+            maAnimations.end(),
+            [&nId](const auto& anim) { return nId == anim->mnAnimationId; }));
     if (iAnimation != maAnimations.end())
     {
         OSL_ASSERT((*iAnimation)->mnAnimationId == nId);
@@ -212,12 +212,10 @@ void Animator::RemoveAnimation (const 
Animator::AnimationId nId)
 
 void Animator::RemoveAllAnimations (void)
 {
-    ::std::for_each(
-        maAnimations.begin(),
-        maAnimations.end(),
-        ::boost::bind(
-            &Animation::Expire,
-            _1));
+        ::std::for_each(
+            maAnimations.begin(),
+            maAnimations.end(),
+            [](auto& anim) { anim->Expire(); });
     maAnimations.clear();
     mnNextAnimationId = 0;
 
diff --git a/main/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx 
b/main/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
index 261b6ac2f6..08567625dd 100644
--- a/main/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
+++ b/main/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
@@ -42,7 +42,7 @@
 #include "app.hrc"
 #include "sdtreelb.hxx"
 #include <sfx2/bindings.hxx>
-#include <boost/bind.hpp>
+#include <memory>
 
 namespace sd { namespace slidesorter { namespace controller {
 
@@ -157,14 +157,13 @@ void DragAndDropContext::UpdatePosition (
     // constant while scrolling.)
     SharedSdWindow pWindow (mpTargetSlideSorter->GetContentWindow());
     const Point aMouseModelPosition (pWindow->PixelToLogic(rMousePosition));
-    ::boost::shared_ptr<InsertionIndicatorHandler> pInsertionIndicatorHandler (
+    ::std::shared_ptr<InsertionIndicatorHandler> pInsertionIndicatorHandler (
         mpTargetSlideSorter->GetController().GetInsertionIndicatorHandler());
 
     if ( ! (bAllowAutoScroll
             && 
mpTargetSlideSorter->GetController().GetScrollBarManager().AutoScroll(
                 rMousePosition,
-                ::boost::bind(
-                    &DragAndDropContext::UpdatePosition, this, rMousePosition, 
eMode, false))))
+                [this, rMousePosition, eMode]() { this->UpdatePosition( 
rMousePosition, eMode, false ); })))
     {
         pInsertionIndicatorHandler->UpdatePosition(aMouseModelPosition, eMode);
 
diff --git a/main/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx 
b/main/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 94f9359263..16a3b82704 100644
--- a/main/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/main/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -89,7 +89,7 @@
 #include <com/sun/star/drawing/XDrawPages.hpp>
 #include <vcl/svapp.hxx>
 
-#include <boost/bind.hpp>
+#include <memory>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -354,7 +354,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest)
             ViewShellBase* pBase = mrSlideSorter.GetViewShellBase();
             if (pBase != NULL)
             {
-                ::boost::shared_ptr<DrawViewShell> pDrawViewShell (
+                ::std::shared_ptr<DrawViewShell> pDrawViewShell (
                     
::boost::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell()));
                 if (pDrawViewShell.get() != NULL)
                     pDrawViewShell->FuSupport(rRequest);
@@ -719,7 +719,7 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet)
                 ViewShellBase* pBase = mrSlideSorter.GetViewShellBase();
                 if (pBase != NULL)
                 {
-                    ::boost::shared_ptr<DrawViewShell> pDrawViewShell (
+                    ::std::shared_ptr<DrawViewShell> pDrawViewShell (
                         
::boost::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell()));
                     if (pDrawViewShell.get() != NULL)
                     {
@@ -1150,13 +1150,10 @@ void SlotManager::DuplicateSelectedSlides (SfxRequest& 
rRequest)
     // Set the selection to the pages in aPagesToSelect.
     PageSelector& rSelector (mrSlideSorter.GetController().GetPageSelector());
     rSelector.DeselectAllPages();
-    ::std::for_each (
-        aPagesToSelect.begin(),
-        aPagesToSelect.end(),
-        ::boost::bind(
-            static_cast<void (PageSelector::*)(const 
SdPage*)>(&PageSelector::SelectPage),
-            ::boost::ref(rSelector),
-            _1));
+        ::std::for_each (
+            aPagesToSelect.begin(),
+            aPagesToSelect.end(),
+            [&](const auto& page) { rSelector.SelectPage( page ); });
 }
 
 

Reply via email to