[Libreoffice-commits] core.git: framework/inc framework/source

Michael Stahl mstahl at redhat.com
Thu Feb 4 14:25:32 UTC 2016


 framework/inc/pch/precompiled_fwe.hxx                   |    1 
 framework/inc/pch/precompiled_fwk.hxx                   |    1 
 framework/source/fwe/helper/undomanagerhelper.cxx       |   49 ++--------------
 framework/source/layoutmanager/toolbarlayoutmanager.cxx |    9 +-
 framework/source/uielement/toolbarmanager.cxx           |    6 +
 5 files changed, 18 insertions(+), 48 deletions(-)

New commits:
commit f600e14561edf3ab35762a39a199ac6d03ab2706
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Feb 4 12:32:17 2016 +0100

    framework: replace boost::bind with C++11 lambda or for loop
    
    Change-Id: I3bee504b5a3dce7d89af77c8fcf2f9e24d5119ca
    Reviewed-on: https://gerrit.libreoffice.org/22105
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/framework/inc/pch/precompiled_fwe.hxx b/framework/inc/pch/precompiled_fwe.hxx
index ed4ba13..8226541 100644
--- a/framework/inc/pch/precompiled_fwe.hxx
+++ b/framework/inc/pch/precompiled_fwe.hxx
@@ -48,7 +48,6 @@
 #include <type_traits>
 #include <utility>
 #include <vector>
-#include <boost/bind.hpp>
 #include <boost/intrusive_ptr.hpp>
 #include <osl/conditn.hxx>
 #include <osl/diagnose.h>
diff --git a/framework/inc/pch/precompiled_fwk.hxx b/framework/inc/pch/precompiled_fwk.hxx
index 2b82988..be4379a 100644
--- a/framework/inc/pch/precompiled_fwk.hxx
+++ b/framework/inc/pch/precompiled_fwk.hxx
@@ -52,7 +52,6 @@
 #include <unordered_map>
 #include <utility>
 #include <vector>
-#include <boost/bind.hpp>
 #include <boost/intrusive_ptr.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/optional.hpp>
diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx b/framework/source/fwe/helper/undomanagerhelper.cxx
index e0a1d0d..bea5277 100644
--- a/framework/source/fwe/helper/undomanagerhelper.cxx
+++ b/framework/source/fwe/helper/undomanagerhelper.cxx
@@ -29,8 +29,6 @@
 #include <tools/diagnose_ex.h>
 #include <osl/conditn.hxx>
 
-#include <boost/bind.hpp>
-
 #include <functional>
 #include <stack>
 #include <queue>
@@ -371,12 +369,7 @@ namespace framework
     void UndoManagerHelper_Impl::enterUndoContext( const OUString& i_title, const bool i_hidden, IMutexGuard& i_instanceLock )
     {
         impl_processRequest(
-            ::boost::bind(
-                &UndoManagerHelper_Impl::impl_enterUndoContext,
-                this,
-                ::boost::cref( i_title ),
-                i_hidden
-            ),
+            [this, &i_title, i_hidden] () { return this->impl_enterUndoContext(i_title, i_hidden); },
             i_instanceLock
         );
     }
@@ -384,10 +377,7 @@ namespace framework
     void UndoManagerHelper_Impl::leaveUndoContext( IMutexGuard& i_instanceLock )
     {
         impl_processRequest(
-            ::boost::bind(
-                &UndoManagerHelper_Impl::impl_leaveUndoContext,
-                this
-            ),
+            [this] () { return this->impl_leaveUndoContext(); },
             i_instanceLock
         );
     }
@@ -402,11 +392,7 @@ namespace framework
             );
 
         impl_processRequest(
-            ::boost::bind(
-                &UndoManagerHelper_Impl::impl_addUndoAction,
-                this,
-                ::boost::ref( i_action )
-            ),
+            [this, &i_action] () { return this->impl_addUndoAction(i_action); },
             i_instanceLock
         );
     }
@@ -414,10 +400,7 @@ namespace framework
     void UndoManagerHelper_Impl::clear( IMutexGuard& i_instanceLock )
     {
         impl_processRequest(
-            ::boost::bind(
-                &UndoManagerHelper_Impl::impl_clear,
-                this
-            ),
+            [this] () { return this->impl_clear(); },
             i_instanceLock
         );
     }
@@ -425,10 +408,7 @@ namespace framework
     void UndoManagerHelper_Impl::clearRedo( IMutexGuard& i_instanceLock )
     {
         impl_processRequest(
-            ::boost::bind(
-                &UndoManagerHelper_Impl::impl_clearRedo,
-                this
-            ),
+            [this] () { return this->impl_clearRedo(); },
             i_instanceLock
         );
     }
@@ -436,10 +416,7 @@ namespace framework
     void UndoManagerHelper_Impl::reset( IMutexGuard& i_instanceLock )
     {
         impl_processRequest(
-            ::boost::bind(
-                &UndoManagerHelper_Impl::impl_reset,
-                this
-            ),
+            [this] () { return this->impl_reset(); },
             i_instanceLock
         );
     }
@@ -894,12 +871,7 @@ namespace framework
     void UndoManagerHelper_Impl::undo( IMutexGuard& i_instanceLock )
     {
         impl_processRequest(
-            ::boost::bind(
-                &UndoManagerHelper_Impl::impl_doUndoRedo,
-                this,
-                ::boost::ref( i_instanceLock ),
-                true
-            ),
+            [this, &i_instanceLock] () { return this->impl_doUndoRedo(i_instanceLock, true); },
             i_instanceLock
         );
     }
@@ -907,12 +879,7 @@ namespace framework
     void UndoManagerHelper_Impl::redo( IMutexGuard& i_instanceLock )
     {
         impl_processRequest(
-            ::boost::bind(
-                &UndoManagerHelper_Impl::impl_doUndoRedo,
-                this,
-                ::boost::ref( i_instanceLock ),
-                false
-            ),
+            [this, &i_instanceLock] () { return this->impl_doUndoRedo(i_instanceLock, false); },
             i_instanceLock
         );
     }
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 31b1912..ad51ba1 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -43,7 +43,6 @@
 #include <vcl/dockingarea.hxx>
 #include <vcl/settings.hxx>
 
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 
@@ -1281,8 +1280,12 @@ void ToolbarLayoutManager::implts_createNonContextSensitiveToolBars()
     }
 
     if ( !aMakeVisibleToolbars.empty() )
-        ::std::for_each( aMakeVisibleToolbars.begin(), aMakeVisibleToolbars.end(),
-                ::boost::bind( &ToolbarLayoutManager::requestToolbar, this, _1));
+    {
+        for (auto const& rURL : aMakeVisibleToolbars)
+        {
+            this->requestToolbar(rURL);
+        }
+    }
 }
 
 void ToolbarLayoutManager::implts_createCustomToolBars( const uno::Sequence< uno::Sequence< beans::PropertyValue > >& aTbxSeqSeq )
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index c83bc19..eab4739 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -63,7 +63,6 @@
 #include <vcl/commandinfoprovider.hxx>
 
 #include <svtools/menuoptions.hxx>
-#include <boost/bind.hpp>
 
 //  namespaces
 
@@ -587,7 +586,10 @@ void ToolBarManager::setToolBarImage(const Image& _aImage,const CommandToInfoMap
 {
     const ::std::vector< sal_uInt16 >& _rIDs = _pIter->second.aIds;
     m_pToolBar->SetItemImage( _pIter->second.nId, _aImage );
-    ::std::for_each(_rIDs.begin(), _rIDs.end(), ::boost::bind(&ToolBox::SetItemImage, m_pToolBar.get(), _1,_aImage));
+    for (auto const& it : _rIDs)
+    {
+        m_pToolBar->SetItemImage(it, _aImage);
+    }
 }
 
 void SAL_CALL ToolBarManager::elementReplaced( const css::ui::ConfigurationEvent& Event ) throw (css::uno::RuntimeException, std::exception)


More information about the Libreoffice-commits mailing list