Kaydet (Commit) 57200e6a authored tarafından Michael Stahl's avatar Michael Stahl

sd: replace boost::bind with C++11 lambdas

Change-Id: I17328cd13b44b4406013ec06521246ad8363b5a3
üst f3ff67d3
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/DisposedException.hpp>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include <algorithm> #include <algorithm>
#include <boost/bind.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
...@@ -70,8 +69,9 @@ void ConfigurationControllerResourceManager::ActivateResources ( ...@@ -70,8 +69,9 @@ void ConfigurationControllerResourceManager::ActivateResources (
::std::for_each( ::std::for_each(
rResources.begin(), rResources.begin(),
rResources.end(), rResources.end(),
::boost::bind(&ConfigurationControllerResourceManager::ActivateResource, [&] (Reference<XResourceId> const& xResource) {
this, _1, rxConfiguration)); return this->ActivateResource(xResource, rxConfiguration);
} );
} }
void ConfigurationControllerResourceManager::DeactivateResources ( void ConfigurationControllerResourceManager::DeactivateResources (
...@@ -85,8 +85,9 @@ void ConfigurationControllerResourceManager::DeactivateResources ( ...@@ -85,8 +85,9 @@ void ConfigurationControllerResourceManager::DeactivateResources (
::std::for_each( ::std::for_each(
rResources.rbegin(), rResources.rbegin(),
rResources.rend(), rResources.rend(),
::boost::bind(&ConfigurationControllerResourceManager::DeactivateResource, [&] (Reference<XResourceId> const& xResource) {
this, _1, rxConfiguration)); return this->DeactivateResource(xResource, rxConfiguration);
} );
} }
/* In this method we do following steps. /* In this method we do following steps.
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <comphelper/scopeguard.hxx> #include <comphelper/scopeguard.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include <boost/bind.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
...@@ -132,7 +131,7 @@ void ConfigurationUpdater::UpdateConfiguration() ...@@ -132,7 +131,7 @@ void ConfigurationUpdater::UpdateConfiguration()
SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": UpdateConfiguration update"); SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": UpdateConfiguration update");
SetUpdateBeingProcessed(true); SetUpdateBeingProcessed(true);
comphelper::ScopeGuard aScopeGuard ( comphelper::ScopeGuard aScopeGuard (
::boost::bind(&ConfigurationUpdater::SetUpdateBeingProcessed, this, false)); [this] () { return this->SetUpdateBeingProcessed(false); });
try try
{ {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/URLTransformer.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <boost/bind.hpp>
#include <algorithm> #include <algorithm>
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -146,10 +146,7 @@ void ResourceFactoryManager::RemoveFactoryForReference( ...@@ -146,10 +146,7 @@ void ResourceFactoryManager::RemoveFactoryForReference(
std::remove_if( std::remove_if(
maFactoryPatternList.begin(), maFactoryPatternList.begin(),
maFactoryPatternList.end(), maFactoryPatternList.end(),
::boost::bind( [&] (FactoryPatternList::value_type const& it) { return it.second == rxFactory; }));
std::equal_to<Reference<XResourceFactory> >(),
::boost::bind(&FactoryPatternList::value_type::second, _1),
rxFactory)));
if (iNewEnd != maFactoryPatternList.end()) if (iNewEnd != maFactoryPatternList.end())
maFactoryPatternList.erase(iNewEnd, maFactoryPatternList.end()); maFactoryPatternList.erase(iNewEnd, maFactoryPatternList.end());
} }
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "DrawController.hxx" #include "DrawController.hxx"
#include "DrawDocShell.hxx" #include "DrawDocShell.hxx"
#include <com/sun/star/drawing/framework/XControllerManager.hpp> #include <com/sun/star/drawing/framework/XControllerManager.hpp>
#include <boost/bind.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
...@@ -73,8 +72,8 @@ public: ...@@ -73,8 +72,8 @@ public:
bool mbIsReleased; bool mbIsReleased;
bool mbIsChildWindow; bool mbIsChildWindow;
bool CompareURL (const OUString& rsPaneURL) { return msPaneURL.equals(rsPaneURL); } bool CompareURL(const OUString& rsPaneURL) const { return msPaneURL.equals(rsPaneURL); }
bool ComparePane (const Reference<XResource>& rxPane) { return mxPane==rxPane; } bool ComparePane(const Reference<XResource>& rxPane) const { return mxPane == rxPane; }
}; };
class BasicPaneFactory::PaneContainer class BasicPaneFactory::PaneContainer
...@@ -221,7 +220,9 @@ Reference<XResource> SAL_CALL BasicPaneFactory::createResource ( ...@@ -221,7 +220,9 @@ Reference<XResource> SAL_CALL BasicPaneFactory::createResource (
::std::find_if ( ::std::find_if (
mpPaneContainer->begin(), mpPaneContainer->begin(),
mpPaneContainer->end(), mpPaneContainer->end(),
::boost::bind(&PaneDescriptor::CompareURL, _1, rxPaneId->getResourceURL()))); [&] (PaneDescriptor const& rPane) {
return rPane.CompareURL(rxPaneId->getResourceURL());
} ));
if (iDescriptor != mpPaneContainer->end()) if (iDescriptor != mpPaneContainer->end())
{ {
...@@ -284,7 +285,7 @@ void SAL_CALL BasicPaneFactory::releaseResource ( ...@@ -284,7 +285,7 @@ void SAL_CALL BasicPaneFactory::releaseResource (
::std::find_if( ::std::find_if(
mpPaneContainer->begin(), mpPaneContainer->begin(),
mpPaneContainer->end(), mpPaneContainer->end(),
::boost::bind(&PaneDescriptor::ComparePane, _1, rxPane))); [&] (PaneDescriptor const& rPane) { return rPane.ComparePane(rxPane); } ));
if (iDescriptor != mpPaneContainer->end()) if (iDescriptor != mpPaneContainer->end())
{ {
...@@ -351,7 +352,7 @@ void SAL_CALL BasicPaneFactory::disposing ( ...@@ -351,7 +352,7 @@ void SAL_CALL BasicPaneFactory::disposing (
::std::find_if ( ::std::find_if (
mpPaneContainer->begin(), mpPaneContainer->begin(),
mpPaneContainer->end(), mpPaneContainer->end(),
::boost::bind(&PaneDescriptor::ComparePane, _1, xPane))); [&] (PaneDescriptor const& rPane) { return rPane.ComparePane(xPane); } ));
if (iDescriptor != mpPaneContainer->end()) if (iDescriptor != mpPaneContainer->end())
{ {
iDescriptor->mxPane = nullptr; iDescriptor->mxPane = nullptr;
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include <vcl/wrkwin.hxx> #include <vcl/wrkwin.hxx>
#include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/vclunohelper.hxx>
#include <boost/bind.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
...@@ -197,7 +196,9 @@ void SAL_CALL BasicViewFactory::releaseResource (const Reference<XResource>& rxV ...@@ -197,7 +196,9 @@ void SAL_CALL BasicViewFactory::releaseResource (const Reference<XResource>& rxV
::std::find_if( ::std::find_if(
mpViewShellContainer->begin(), mpViewShellContainer->begin(),
mpViewShellContainer->end(), mpViewShellContainer->end(),
::boost::bind(&ViewDescriptor::CompareView, _1, rxView))); [&] (std::shared_ptr<ViewDescriptor> const& pVD) {
return ViewDescriptor::CompareView(pVD, rxView);
} ));
if (iViewShell != mpViewShellContainer->end()) if (iViewShell != mpViewShellContainer->end())
{ {
std::shared_ptr<ViewShell> pViewShell ((*iViewShell)->mpViewShell); std::shared_ptr<ViewShell> pViewShell ((*iViewShell)->mpViewShell);
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "tools/ConfigurationAccess.hxx" #include "tools/ConfigurationAccess.hxx"
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <boost/bind.hpp>
#include <unordered_map> #include <unordered_map>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
...@@ -105,7 +104,9 @@ void ModuleController::LoadFactories (const Reference<XComponentContext>& rxCont ...@@ -105,7 +104,9 @@ void ModuleController::LoadFactories (const Reference<XComponentContext>& rxCont
ConfigurationAccess::ForAll( ConfigurationAccess::ForAll(
xFactories, xFactories,
aProperties, aProperties,
::boost::bind(&ModuleController::ProcessFactory, this, _2)); [this] (OUString const&, ::std::vector<Any> const& xs) {
return this->ProcessFactory(xs);
} );
} }
catch (Exception&) catch (Exception&)
{ {
...@@ -157,7 +158,9 @@ void ModuleController::InstantiateStartupServices() ...@@ -157,7 +158,9 @@ void ModuleController::InstantiateStartupServices()
tools::ConfigurationAccess::ForAll( tools::ConfigurationAccess::ForAll(
xFactories, xFactories,
aProperties, aProperties,
::boost::bind(&ModuleController::ProcessStartupService, this, _2)); [this] (OUString const&, ::std::vector<Any> const& xs) {
return this->ProcessStartupService(xs);
} );
} }
catch (Exception&) catch (Exception&)
{ {
......
...@@ -38,7 +38,7 @@ namespace sd { namespace tools { ...@@ -38,7 +38,7 @@ namespace sd { namespace tools {
Use this class like this: Use this class like this:
aInstanceOfAsynchronousCall.Post( aInstanceOfAsynchronousCall.Post(
::boost::bind( ::std::bind(
::std::mem_fun(&DrawViewShell::SwitchPage), ::std::mem_fun(&DrawViewShell::SwitchPage),
pDrawViewShell, pDrawViewShell,
11)); 11));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment