diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-19 13:43:23 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-20 08:14:13 +0000 |
commit | fe3fd05966a668c1cdf53e8221b8614e9a07de65 (patch) | |
tree | 4c6c105b78d0cb9c45431c2fecd2583d6a2aa85c /dbaccess | |
parent | 1d5c39192e81f950289dbdd7991a0e8a67c0aabc (diff) |
add mapKeysToSequence/mapValuesToSequence methods to comphelper
and use them
Change-Id: If4dc9df63db37185228aeaaab2979498d61304ec
Reviewed-on: https://gerrit.libreoffice.org/20055
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/dataaccess/documentevents.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/genericcontroller.cxx | 9 |
2 files changed, 3 insertions, 16 deletions
diff --git a/dbaccess/source/core/dataaccess/documentevents.cxx b/dbaccess/source/core/dataaccess/documentevents.cxx index 5b77496bd043..3d0057650068 100644 --- a/dbaccess/source/core/dataaccess/documentevents.cxx +++ b/dbaccess/source/core/dataaccess/documentevents.cxx @@ -23,6 +23,7 @@ #include <osl/diagnose.h> #include <comphelper/namedvaluecollection.hxx> +#include <comphelper/sequence.hxx> #include <algorithm> #include <functional> @@ -200,14 +201,7 @@ namespace dbaccess { ::osl::MutexGuard aGuard( m_pData->rMutex ); - Sequence< OUString > aNames( m_pData->rEventsData.size() ); - ::std::transform( - m_pData->rEventsData.begin(), - m_pData->rEventsData.end(), - aNames.getArray(), - ::o3tl::select1st< DocumentEventsData::value_type >() - ); - return aNames; + return comphelper::mapKeysToSequence( m_pData->rEventsData ); } sal_Bool SAL_CALL DocumentEvents::hasByName( const OUString& _Name ) throw (RuntimeException, std::exception) diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 29efea37a09c..1230c17a3e84 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -1443,14 +1443,7 @@ Sequence< ::sal_Int16 > SAL_CALL OGenericUnoController::getSupportedCommandGroup if ( aIter->second.GroupId != CommandGroup::INTERNAL ) aCmdHashMap.insert( CommandHashMap::value_type( aIter->second.GroupId, 0 )); - Sequence< sal_Int16 > aCommandGroups( aCmdHashMap.size() ); - ::std::transform( aCmdHashMap.begin(), - aCmdHashMap.end(), - aCommandGroups.getArray(), - ::o3tl::select1st< CommandHashMap::value_type >() - ); - - return aCommandGroups; + return comphelper::mapKeysToSequence( aCmdHashMap ); } namespace |