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 253cceb53c8c5bbc5488c207dff5bb517c2b4f6d
Author: Pedro F. Giffuni <[email protected]>
AuthorDate: Fri Nov 6 00:24:25 2026 -0500

    Boost modernization Phase 3 continued: boost::bind to C++14 lambdas (~20 
more files)
    
    - Replace boost::bind with C++14 lambdas in:
      - slideshow/source/engine/shapes/drawshape.cxx (count_if with mem_fn, 
ScopeGuard setTransformation x2, find_if with getViewLayer x3)
    - Remove #include <boost/bind.hpp> where no longer needed
---
 main/slideshow/source/engine/shapes/drawshape.cxx | 38 ++++-------------------
 1 file changed, 6 insertions(+), 32 deletions(-)

diff --git a/main/slideshow/source/engine/shapes/drawshape.cxx 
b/main/slideshow/source/engine/shapes/drawshape.cxx
index 27a5a0dfed..d869232e27 100644
--- a/main/slideshow/source/engine/shapes/drawshape.cxx
+++ b/main/slideshow/source/engine/shapes/drawshape.cxx
@@ -75,7 +75,6 @@
 #include "gdimtftools.hxx"
 #include "drawinglayeranimation.hxx"
 
-#include <boost/bind.hpp>
 #include <math.h>
 
 using namespace ::com::sun::star;
@@ -214,17 +213,7 @@ namespace slideshow
             ViewShape::RenderArgs aViewRenderArgs = getViewRenderArgs();
             if( ::std::count_if( maViewShapes.begin(),
                                  maViewShapes.end(),
-                                 ::boost::bind<bool>(
-                                     ::boost::mem_fn( &ViewShape::update ), // 
though _theoretically_,
-                                                                               
                                // bind should eat this even
-                                                                               
                                // with _1 being a shared_ptr,
-                                                                               
                                // it does _not_ for MSVC without
-                                                                               
                                // the extra mem_fn. WTF.
-                                     _1,
-                                     ::boost::cref( mpCurrMtf ),
-                                     ::boost::cref( aViewRenderArgs ),
-                                     nUpdateFlags,
-                                     isVisible() ) )
+                                 [&](const auto& vs) { return vs->update( 
mpCurrMtf, aViewRenderArgs, nUpdateFlags, isVisible() ); } )
                 != 
static_cast<ViewShapeVector::difference_type>(maViewShapes.size()) )
             {
                 // at least one of the ViewShape::update() calls did return
@@ -365,8 +354,7 @@ namespace slideshow
 
                         // restore old transformation when leaving the scope
                         const ::comphelper::ScopeGuard aGuard(
-                            boost::bind( 
&::cppcanvas::Canvas::setTransformation,
-                                         pDestinationCanvas, aOldTransform ) );
+                            [&]() { pDestinationCanvas->setTransformation( 
aOldTransform ); } );
 
 
                         // retrieve bounds for subset of whole metafile
@@ -683,11 +671,7 @@ namespace slideshow
             // already added?
             if( ::std::find_if( maViewShapes.begin(),
                                 aEnd,
-                                ::boost::bind<bool>(
-                                    ::std::equal_to< ViewLayerSharedPtr >(),
-                                    ::boost::bind( &ViewShape::getViewLayer,
-                                                   _1 ),
-                                    ::boost::cref( rNewLayer ) ) ) != aEnd )
+                                [&rNewLayer](const auto& vs) { return 
rNewLayer == vs->getViewLayer(); } ) != aEnd )
             {
                 // yes, nothing to do
                 return;
@@ -720,22 +704,14 @@ namespace slideshow
 
             OSL_ENSURE( ::std::count_if(maViewShapes.begin(),
                                         aEnd,
-                                        ::boost::bind<bool>(
-                                            ::std::equal_to< 
ViewLayerSharedPtr >(),
-                                            ::boost::bind( 
&ViewShape::getViewLayer,
-                                                           _1 ),
-                                            ::boost::cref( rLayer ) ) ) < 2,
+                                        [&rLayer](const auto& vs) { return 
rLayer == vs->getViewLayer(); } ) < 2,
                         "DrawShape::removeViewLayer(): Duplicate ViewLayer 
entries!" );
 
             ViewShapeVector::iterator aIter;
 
             if( (aIter=::std::remove_if( maViewShapes.begin(),
                                          aEnd,
-                                         ::boost::bind<bool>(
-                                             ::std::equal_to< 
ViewLayerSharedPtr >(),
-                                             ::boost::bind( 
&ViewShape::getViewLayer,
-                                                            _1 ),
-                                             ::boost::cref( rLayer ) ) )) == 
aEnd )
+                                         [&rLayer](const auto& vs) { return 
rLayer == vs->getViewLayer(); } )) == aEnd )
             {
                 // view layer seemingly was not added, failed
                 return false;
@@ -1053,9 +1029,7 @@ namespace slideshow
                     pCanvas->setTransformation( aTransform /* empty */ );
 
                     comphelper::ScopeGuard const resetOldTransformation(
-                        boost::bind( &cppcanvas::Canvas::setTransformation,
-                                     pCanvas.get(),
-                                     boost::cref(aOldTransform) ));
+                        [&]() { pCanvas->setTransformation( aOldTransform ); } 
);
 
                     aTransform.scale( maBounds.getWidth(),
                                       maBounds.getHeight() );

Reply via email to