diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-03-02 21:50:00 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-03-02 22:28:49 +0100 |
commit | 57200e6a1cbea3201dc6c0b20e483b29ad979599 (patch) | |
tree | 767cc3691e554417a6bd314fc4810ab9ef591ea2 /sd | |
parent | f3ff67d3c3047de3ad43f8bb3f805d82eaef0479 (diff) |
sd: replace boost::bind with C++11 lambdas
Change-Id: I17328cd13b44b4406013ec06521246ad8363b5a3
Diffstat (limited to 'sd')
7 files changed, 26 insertions, 24 deletions
diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx index 38f3aac13e51..394718cb0957 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 3cf708074154..386613073a77 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 85cc18070772..d767f6024e62 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 807119d65ec6..aa072a15ed88 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 870bc59e3c7b..7f40961e1be6 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 fa63b77b128e..c8c520aa764e 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 2733f2242e09..6320db7037d7 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)); |