include/oox/helper/refmap.hxx |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 1575c9c6d370c04e411c3472429140793f322548
Author:     Ion Rusnac <[email protected]>
AuthorDate: Sat Dec 6 10:51:57 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Dec 18 08:19:19 2025 +0100

    tdf#165233 Use lambdas instead of std::bind
    
    Change-Id: I9f346968ba16f6077e7374d75c1939bc3d184ea5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195156
    Tested-by: Jenkins
    Reviewed-by: Gabriel Masei <[email protected]>

diff --git a/include/oox/helper/refmap.hxx b/include/oox/helper/refmap.hxx
index 4e5efe6c233c..6fc7c747a2df 100644
--- a/include/oox/helper/refmap.hxx
+++ b/include/oox/helper/refmap.hxx
@@ -75,7 +75,9 @@ public:
     template< typename FuncType >
     void                forEachMem( FuncType pFunc ) const
                         {
-                            forEach( ::std::bind( pFunc, std::placeholders::_1 
) );
+                            forEach( [pFunc] ( auto& rObj ) {
+                                (rObj.*pFunc)();
+                            } );
                         }
 
     /** Calls the passed member function of ObjType on every contained object,
@@ -83,7 +85,9 @@ public:
     template< typename FuncType, typename ParamType1, typename ParamType2 >
     void                forEachMem( FuncType pFunc, ParamType1 aParam1, 
ParamType2 aParam2 ) const
                         {
-                            forEach( ::std::bind( pFunc, 
std::placeholders::_1, aParam1, aParam2 ) );
+                            forEach( [pFunc, aParam1, aParam2] (auto& rObj) {
+                                (rObj.*pFunc)(aParam1, aParam2);
+                            } );
                         }
 
     /** Calls the passed member function of ObjType on every contained object,
@@ -91,7 +95,9 @@ public:
     template< typename FuncType, typename ParamType1, typename ParamType2, 
typename ParamType3 >
     void                forEachMem( FuncType pFunc, ParamType1 aParam1, 
ParamType2 aParam2, ParamType3 aParam3 ) const
                         {
-                            forEach( ::std::bind( pFunc, 
std::placeholders::_1, aParam1, aParam2, aParam3 ) );
+                            forEach( [pFunc, aParam1, aParam2, aParam3] (auto& 
rObj) {
+                                (rObj.*pFunc)(aParam1, aParam2, aParam3);
+                            } );
                         }
 
 
@@ -108,7 +114,9 @@ public:
     template< typename FuncType >
     void                forEachMemWithKey( FuncType pFunc ) const
                         {
-                            forEachWithKey( ::std::bind( pFunc, 
std::placeholders::_2, std::placeholders::_1 ) );
+                            forEachWithKey( [pFunc] ( const auto& rKey, auto& 
rObj ) {
+                                (rObj.*pFunc)(rKey);
+                            } );
                         }
 
 

Reply via email to