[Libreoffice-commits] core.git: sd/source

Michael Stahl mstahl at redhat.com
Wed Mar 2 21:31:19 UTC 2016


 sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx |   11 ++++----
 sd/source/ui/framework/configuration/ConfigurationUpdater.cxx                   |    3 --
 sd/source/ui/framework/configuration/ResourceFactoryManager.cxx                 |    7 +----
 sd/source/ui/framework/factories/BasicPaneFactory.cxx                           |   13 +++++-----
 sd/source/ui/framework/factories/BasicViewFactory.cxx                           |    5 ++-
 sd/source/ui/framework/module/ModuleController.cxx                              |    9 ++++--
 sd/source/ui/inc/tools/AsynchronousCall.hxx                                     |    2 -
 7 files changed, 26 insertions(+), 24 deletions(-)

New commits:
commit 57200e6a1cbea3201dc6c0b20e483b29ad979599
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 2 21:50:00 2016 +0100

    sd: replace boost::bind with C++11 lambdas
    
    Change-Id: I17328cd13b44b4406013ec06521246ad8363b5a3

diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx
index 38f3aac..394718c 100644
--- a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx
@@ -24,7 +24,6 @@
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <tools/diagnose_ex.h>
 #include <algorithm>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -70,8 +69,9 @@ void ConfigurationControllerResourceManager::ActivateResources (
     ::std::for_each(
         rResources.begin(),
         rResources.end(),
-        ::boost::bind(&ConfigurationControllerResourceManager::ActivateResource,
-            this, _1, rxConfiguration));
+        [&] (Reference<XResourceId> const& xResource) {
+            return this->ActivateResource(xResource, rxConfiguration);
+        } );
 }
 
 void ConfigurationControllerResourceManager::DeactivateResources (
@@ -85,8 +85,9 @@ void ConfigurationControllerResourceManager::DeactivateResources (
     ::std::for_each(
         rResources.rbegin(),
         rResources.rend(),
-        ::boost::bind(&ConfigurationControllerResourceManager::DeactivateResource,
-            this, _1, rxConfiguration));
+        [&] (Reference<XResourceId> const& xResource) {
+            return this->DeactivateResource(xResource, rxConfiguration);
+        } );
 }
 
 /* In this method we do following steps.
diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
index 3cf7080..3866130 100644
--- a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
@@ -27,7 +27,6 @@
 #include <comphelper/scopeguard.hxx>
 #include <tools/diagnose_ex.h>
 
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -132,7 +131,7 @@ void ConfigurationUpdater::UpdateConfiguration()
     SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": UpdateConfiguration update");
     SetUpdateBeingProcessed(true);
     comphelper::ScopeGuard aScopeGuard (
-        ::boost::bind(&ConfigurationUpdater::SetUpdateBeingProcessed, this, false));
+        [this] () { return this->SetUpdateBeingProcessed(false); });
 
     try
     {
diff --git a/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx b/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx
index 85cc180..d767f60 100644
--- a/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx
+++ b/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx
@@ -24,7 +24,7 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/util/URLTransformer.hpp>
 #include <comphelper/processfactory.hxx>
-#include <boost/bind.hpp>
+
 #include <algorithm>
 
 using namespace ::com::sun::star;
@@ -146,10 +146,7 @@ void ResourceFactoryManager::RemoveFactoryForReference(
         std::remove_if(
             maFactoryPatternList.begin(),
             maFactoryPatternList.end(),
-            ::boost::bind(
-                std::equal_to<Reference<XResourceFactory> >(),
-                ::boost::bind(&FactoryPatternList::value_type::second, _1),
-                rxFactory)));
+            [&] (FactoryPatternList::value_type const& it) { return it.second == rxFactory; }));
     if (iNewEnd != maFactoryPatternList.end())
         maFactoryPatternList.erase(iNewEnd, maFactoryPatternList.end());
 }
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index 807119d..aa072a1 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -34,7 +34,6 @@
 #include "DrawController.hxx"
 #include "DrawDocShell.hxx"
 #include <com/sun/star/drawing/framework/XControllerManager.hpp>
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -73,8 +72,8 @@ public:
     bool mbIsReleased;
     bool mbIsChildWindow;
 
-    bool CompareURL (const OUString& rsPaneURL) { return msPaneURL.equals(rsPaneURL); }
-    bool ComparePane (const Reference<XResource>& rxPane) { return mxPane==rxPane; }
+    bool CompareURL(const OUString& rsPaneURL) const { return msPaneURL.equals(rsPaneURL); }
+    bool ComparePane(const Reference<XResource>& rxPane) const { return mxPane == rxPane; }
 };
 
 class BasicPaneFactory::PaneContainer
@@ -221,7 +220,9 @@ Reference<XResource> SAL_CALL BasicPaneFactory::createResource (
         ::std::find_if (
             mpPaneContainer->begin(),
             mpPaneContainer->end(),
-            ::boost::bind(&PaneDescriptor::CompareURL, _1, rxPaneId->getResourceURL())));
+            [&] (PaneDescriptor const& rPane) {
+                return rPane.CompareURL(rxPaneId->getResourceURL());
+            } ));
 
     if (iDescriptor != mpPaneContainer->end())
     {
@@ -284,7 +285,7 @@ void SAL_CALL BasicPaneFactory::releaseResource (
         ::std::find_if(
             mpPaneContainer->begin(),
             mpPaneContainer->end(),
-            ::boost::bind(&PaneDescriptor::ComparePane, _1, rxPane)));
+            [&] (PaneDescriptor const& rPane) { return rPane.ComparePane(rxPane); } ));
 
     if (iDescriptor != mpPaneContainer->end())
     {
@@ -351,7 +352,7 @@ void SAL_CALL BasicPaneFactory::disposing (
             ::std::find_if (
                 mpPaneContainer->begin(),
                 mpPaneContainer->end(),
-                ::boost::bind(&PaneDescriptor::ComparePane, _1, xPane)));
+                [&] (PaneDescriptor const& rPane) { return rPane.ComparePane(xPane); } ));
         if (iDescriptor != mpPaneContainer->end())
         {
             iDescriptor->mxPane = nullptr;
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 870bc59..7f40961 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -41,7 +41,6 @@
 #include <vcl/wrkwin.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 
-#include <boost/bind.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -197,7 +196,9 @@ void SAL_CALL BasicViewFactory::releaseResource (const Reference<XResource>& rxV
             ::std::find_if(
                 mpViewShellContainer->begin(),
                 mpViewShellContainer->end(),
-                ::boost::bind(&ViewDescriptor::CompareView, _1, rxView)));
+                [&] (std::shared_ptr<ViewDescriptor> const& pVD) {
+                    return ViewDescriptor::CompareView(pVD, rxView);
+                } ));
         if (iViewShell != mpViewShellContainer->end())
         {
             std::shared_ptr<ViewShell> pViewShell ((*iViewShell)->mpViewShell);
diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx
index fa63b77..c8c520a 100644
--- a/sd/source/ui/framework/module/ModuleController.cxx
+++ b/sd/source/ui/framework/module/ModuleController.cxx
@@ -21,7 +21,6 @@
 
 #include "tools/ConfigurationAccess.hxx"
 #include <comphelper/processfactory.hxx>
-#include <boost/bind.hpp>
 #include <unordered_map>
 
 #include <tools/diagnose_ex.h>
@@ -105,7 +104,9 @@ void ModuleController::LoadFactories (const Reference<XComponentContext>& rxCont
         ConfigurationAccess::ForAll(
             xFactories,
             aProperties,
-            ::boost::bind(&ModuleController::ProcessFactory, this, _2));
+            [this] (OUString const&, ::std::vector<Any> const& xs) {
+                return this->ProcessFactory(xs);
+            } );
     }
     catch (Exception&)
     {
@@ -157,7 +158,9 @@ void ModuleController::InstantiateStartupServices()
         tools::ConfigurationAccess::ForAll(
             xFactories,
             aProperties,
-            ::boost::bind(&ModuleController::ProcessStartupService, this, _2));
+            [this] (OUString const&, ::std::vector<Any> const& xs) {
+                return this->ProcessStartupService(xs);
+            } );
     }
     catch (Exception&)
     {
diff --git a/sd/source/ui/inc/tools/AsynchronousCall.hxx b/sd/source/ui/inc/tools/AsynchronousCall.hxx
index 2733f22..6320db7 100644
--- a/sd/source/ui/inc/tools/AsynchronousCall.hxx
+++ b/sd/source/ui/inc/tools/AsynchronousCall.hxx
@@ -38,7 +38,7 @@ namespace sd { namespace tools {
 
     Use this class like this:
     aInstanceOfAsynchronousCall.Post(
-        ::boost::bind(
+        ::std::bind(
             ::std::mem_fun(&DrawViewShell::SwitchPage),
             pDrawViewShell,
             11));


More information about the Libreoffice-commits mailing list