From 5916d5866c109b17471a9c8604635612a0aa69ae Mon Sep 17 00:00:00 2001 From: Daniel Robertson Date: Fri, 31 Jul 2015 10:24:01 -0400 Subject: tdf#92459 replace deprecated o3tl features Replace all uses of deprecated features from o3tl/compat_functional.hxx with lambda expressions. Change-Id: I6370c80dbe675da517904e535e19bf63830c3e2c Reviewed-on: https://gerrit.libreoffice.org/17450 Reviewed-by: David Ostrovsky Tested-by: David Ostrovsky --- chart2/inc/pch/precompiled_chartcontroller.hxx | 1 - chart2/inc/pch/precompiled_chartcore.hxx | 1 - chart2/source/controller/accessibility/AccessibleBase.cxx | 4 ++-- .../source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 4 ++-- chart2/source/controller/dialogs/DialogModel.cxx | 9 ++++----- chart2/source/inc/CommonFunctors.hxx | 8 +++----- chart2/source/inc/ContainerHelper.hxx | 7 ++++--- chart2/source/model/template/ChartTypeManager.cxx | 4 ++-- 8 files changed, 17 insertions(+), 21 deletions(-) (limited to 'chart2') diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx index f6ebf367020e..2805e0be0ad9 100644 --- a/chart2/inc/pch/precompiled_chartcontroller.hxx +++ b/chart2/inc/pch/precompiled_chartcontroller.hxx @@ -193,7 +193,6 @@ #include #include #include -#include #include #include #include diff --git a/chart2/inc/pch/precompiled_chartcore.hxx b/chart2/inc/pch/precompiled_chartcore.hxx index 30ecb465e451..5bf7c8a5b45c 100644 --- a/chart2/inc/pch/precompiled_chartcore.hxx +++ b/chart2/inc/pch/precompiled_chartcore.hxx @@ -248,7 +248,6 @@ #include #include #include -#include #include #include #include diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index c2726669d643..dc3832dd5a29 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -50,7 +50,6 @@ #include #include -#include #include "ChartElementFactory.hxx" @@ -252,7 +251,8 @@ bool AccessibleBase::ImplUpdateChildren() aAccChildren.reserve( aModelChildren.size()); ::std::transform( m_aChildOIDMap.begin(), m_aChildOIDMap.end(), ::std::back_inserter( aAccChildren ), - ::o3tl::select1st< ChildOIDMap::value_type >()); + []( const ::std::pair& cp ) + { return cp.first; } ); ::std::sort( aModelChildren.begin(), aModelChildren.end()); diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index d89abccf42ae..d34d9977aa23 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -66,7 +66,6 @@ #include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::chart; @@ -1460,7 +1459,8 @@ uno::Sequence< OUString > SAL_CALL ChartDocumentWrapper::getAvailableServiceName ::std::transform( rMap.begin(), rMap.end(), aResult.getArray(), - ::o3tl::select1st< tServiceNameMap::value_type >() ); + []( const ::std::pair< OUString, eServiceType >& cp ) + { return cp.first; } ); return aResult; diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index 6127ee9cb6d9..e017ddc9e377 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -47,7 +47,6 @@ #include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; @@ -110,10 +109,10 @@ OUString lcl_ConvertRole( const OUString & rRoleString, bool bFromInternalToUI ) { tTranslationMap::const_iterator aIt( ::std::find_if( aTranslationMap.begin(), aTranslationMap.end(), - ::o3tl::compose1( ::std::bind2nd( - ::std::equal_to< tTranslationMap::mapped_type >(), - rRoleString ), - ::o3tl::select2nd< tTranslationMap::value_type >()))); + [&rRoleString] + ( const ::std::pair< OUString, OUString >& cp ) + { return rRoleString == cp.second; } ) + ); if( aIt != aTranslationMap.end()) aResult = (*aIt).first; diff --git a/chart2/source/inc/CommonFunctors.hxx b/chart2/source/inc/CommonFunctors.hxx index c7bcff16c897..596af8ac9bfc 100644 --- a/chart2/source/inc/CommonFunctors.hxx +++ b/chart2/source/inc/CommonFunctors.hxx @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -185,10 +184,9 @@ template< class MapType > findValueInMap( const MapType & rMap, const typename MapType::mapped_type & rData ) { return ::std::find_if( rMap.begin(), rMap.end(), - ::o3tl::compose1( ::std::bind2nd( - ::std::equal_to< typename MapType::mapped_type >(), - rData ), - ::o3tl::select2nd< typename MapType::value_type >())); + [&rData] + ( const ::std::pair< typename MapType::key_type, typename MapType::mapped_type >& cp ) + { return rData == cp.second; } ); } } // namespace CommonFunctors diff --git a/chart2/source/inc/ContainerHelper.hxx b/chart2/source/inc/ContainerHelper.hxx index d6eee1a9aa61..655a01eb22d3 100644 --- a/chart2/source/inc/ContainerHelper.hxx +++ b/chart2/source/inc/ContainerHelper.hxx @@ -25,7 +25,6 @@ #include #include -#include namespace chart { @@ -143,7 +142,8 @@ template< class Map > { ::com::sun::star::uno::Sequence< typename Map::key_type > aResult( rCont.size()); ::std::transform( rCont.begin(), rCont.end(), aResult.getArray(), - ::o3tl::select1st< typename Map::value_type >()); + []( const ::std::pair< typename Map::key_type, typename Map::mapped_type >& cp ) + { return cp.first; } ); return aResult; } @@ -160,7 +160,8 @@ template< class Map > { ::com::sun::star::uno::Sequence< typename Map::mapped_type > aResult( rCont.size()); ::std::transform( rCont.begin(), rCont.end(), aResult.getArray(), - ::o3tl::select2nd< typename Map::value_type >()); + []( const ::std::pair< typename Map::key_type, typename Map::mapped_type >& cp ) + { return cp.second; } ); return aResult; } diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index 1425813c0f54..17abb3531318 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -45,7 +45,6 @@ #include #include #include -#include using namespace ::com::sun::star; @@ -575,7 +574,8 @@ uno::Sequence< OUString > SAL_CALL ChartTypeManager::getAvailableServiceNames() // get own default templates ::std::transform( rMap.begin(), rMap.end(), ::std::back_inserter( aServices ), - ::o3tl::select1st< tTemplateMapType::value_type >()); + []( const ::std::pair< OUString, TemplateId >& cp ) + { return cp.first; } ); // add components that were registered in the context's factory uno::Reference< container::XContentEnumerationAccess > xEnumAcc( -- cgit