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 @@
#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.
......
......@@ -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
{
......
......@@ -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());
}
......
......@@ -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;
......
......@@ -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);
......
......@@ -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&)
{
......
......@@ -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));
......
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