summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorDaniel Robertson <danlrobertson89@gmail.com>2015-08-11 14:51:35 -0400
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-08-11 22:29:12 +0000
commit87130a4e18347d055331ff53da3b1a79548ff24a (patch)
treef1d3cfe7b7a2a9e7c9b3efbeddf23da9e7b9845e /canvas
parentae6afadbc0c6ffcdbfd0db6bb3b0166295d5effd (diff)
tdf#92459 Cleanup unclear lambdas
Replace lambdas used to select the first/second member of a pair with the new simplified select1st/2nd from o3tl/compat_functional. There should be no side effects due to this change. Change-Id: I17f37796e0c4defe96a10aa491d192adb9eebb89 Reviewed-on: https://gerrit.libreoffice.org/17656 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/factory/cf_service.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx
index 677cf4271020..9d1d2b290cee 100644
--- a/canvas/source/factory/cf_service.cxx
+++ b/canvas/source/factory/cf_service.cxx
@@ -38,7 +38,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx>
#include <osl/process.h>
-
+#include <o3tl/compat_functional.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -52,8 +52,10 @@ class CanvasFactory
lang::XMultiComponentFactory,
lang::XMultiServiceFactory >
{
- typedef std::vector<std::pair<OUString, Sequence<OUString> > > AvailVector;
- typedef std::vector<std::pair<OUString, OUString> > CacheVector;
+ typedef std::pair< OUString, Sequence< OUString > > AvailPair;
+ typedef std::pair< OUString, OUString > CachePair;
+ typedef std::vector< AvailPair > AvailVector;
+ typedef std::vector< CachePair > CacheVector;
mutable ::osl::Mutex m_mutex;
@@ -238,9 +240,7 @@ Sequence<OUString> CanvasFactory::getAvailableServiceNames()
std::transform(m_aAvailableImplementations.begin(),
m_aAvailableImplementations.end(),
aServiceNames.getArray(),
- [](std::pair<OUString, Sequence<OUString> > const& ap)
- { return ap.first; }
- );
+ o3tl::select1st< AvailPair >());
return aServiceNames;
}
@@ -326,7 +326,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
if( (aMatch=std::find_if(
m_aCachedImplementations.begin(),
aEnd,
- [&serviceName](std::pair<OUString, OUString> const& cp)
+ [&serviceName](CachePair const& cp)
{ return serviceName.equals(cp.first); }
)) != aEnd) {
Reference<XInterface> xCanvas( use( aMatch->second, args, xContext ) );
@@ -340,7 +340,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
if( (aAvailImplsMatch=std::find_if(
m_aAvailableImplementations.begin(),
aAvailEnd,
- [&serviceName](std::pair<OUString, Sequence<OUString> > const& ap)
+ [&serviceName](AvailPair const& ap)
{ return serviceName.equals(ap.first); }
)) == aAvailEnd ) {
return Reference<XInterface>();
@@ -351,7 +351,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
if( (aAAImplsMatch=std::find_if(
m_aAAImplementations.begin(),
aAAEnd,
- [&serviceName](std::pair<OUString, Sequence<OUString> > const& ap)
+ [&serviceName](AvailPair const& ap)
{ return serviceName.equals(ap.first); }
)) == aAAEnd) {
return Reference<XInterface>();
@@ -362,7 +362,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
if( (aAccelImplsMatch=std::find_if(
m_aAcceleratedImplementations.begin(),
aAccelEnd,
- [&serviceName](std::pair<OUString, Sequence<OUString> > const& ap)
+ [&serviceName](AvailPair const& ap)
{ return serviceName.equals(ap.first); }
)) == aAccelEnd ) {
return Reference<XInterface>();