summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-19 13:43:23 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-20 08:14:13 +0000
commitfe3fd05966a668c1cdf53e8221b8614e9a07de65 (patch)
tree4c6c105b78d0cb9c45431c2fecd2583d6a2aa85c /svx
parent1d5c39192e81f950289dbdd7991a0e8a67c0aabc (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 'svx')
-rw-r--r--svx/source/form/formcontroller.cxx8
-rw-r--r--svx/source/table/tabledesign.cxx11
-rw-r--r--svx/source/unodraw/unoprov.cxx12
3 files changed, 5 insertions, 26 deletions
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index b9883714d1d5..ce7fa4d60649 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -4046,13 +4046,7 @@ void SAL_CALL FormController::invalidateAllFeatures( ) throw (RuntimeException,
{
::osl::ClearableMutexGuard aGuard( m_aMutex );
- Sequence< sal_Int16 > aInterceptedFeatures( m_aFeatureDispatchers.size() );
- ::std::transform(
- m_aFeatureDispatchers.begin(),
- m_aFeatureDispatchers.end(),
- aInterceptedFeatures.getArray(),
- ::o3tl::select1st< DispatcherContainer::value_type >()
- );
+ Sequence< sal_Int16 > aInterceptedFeatures( comphelper::mapKeysToSequence(m_aFeatureDispatchers) );
aGuard.clear();
if ( aInterceptedFeatures.getLength() )
diff --git a/svx/source/table/tabledesign.cxx b/svx/source/table/tabledesign.cxx
index 966f811c3756..c3cca01915f7 100644
--- a/svx/source/table/tabledesign.cxx
+++ b/svx/source/table/tabledesign.cxx
@@ -36,6 +36,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/sequence.hxx>
#include "svx/unoprov.hxx"
#include "svx/sdr/table/tabledesign.hxx"
@@ -301,15 +302,7 @@ Sequence< OUString > SAL_CALL TableDesignStyle::getElementNames() throw(RuntimeE
{
SolarMutexGuard aGuard;
- const CellStyleNameMap& rMap = getCellStyleNameMap();
- Sequence< OUString > aRet( rMap.size() );
- OUString* pName = aRet.getArray();
-
- CellStyleNameMap::const_iterator iter = rMap.begin();
- while( iter != rMap.end() )
- *pName++ = (*iter++).first;
-
- return aRet;
+ return comphelper::mapKeysToSequence( getCellStyleNameMap() );
}
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 7c9e150f9511..98472cf36e4f 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -31,6 +31,7 @@
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/propertysetinfo.hxx>
+#include <comphelper/sequence.hxx>
#include <svx/dialmgr.hxx>
#include "svx/unoapi.hxx"
#include <editeng/unotext.hxx>
@@ -874,16 +875,7 @@ OUString UHashMap::getNameFromId(sal_uInt32 nId)
uno::Sequence< OUString > UHashMap::getServiceNames()
{
- const UHashMapImpl &rMap = GetUHashImpl();
-
- uno::Sequence< OUString > aSeq( rMap.size() );
- OUString* pStrings = aSeq.getArray();
-
- int i = 0;
- for (UHashMapImpl::const_iterator it = rMap.begin(); it != rMap.end(); ++it)
- pStrings[i++] = it->first;
-
- return aSeq;
+ return comphelper::mapKeysToSequence( GetUHashImpl() );
}
sal_uInt32 UHashMap::getId( const OUString& rCompareString )