From fe3fd05966a668c1cdf53e8221b8614e9a07de65 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 19 Nov 2015 13:43:23 +0200 Subject: add mapKeysToSequence/mapValuesToSequence methods to comphelper and use them Change-Id: If4dc9df63db37185228aeaaab2979498d61304ec Reviewed-on: https://gerrit.libreoffice.org/20055 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vbahelper/source/vbahelper/vbadocumentsbase.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'vbahelper/source') diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index c5a547735e2d..ae8098d8150f 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -184,13 +185,7 @@ public: virtual uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (uno::RuntimeException, std::exception) override { - uno::Sequence< OUString > names( namesToIndices.size() ); - OUString* pString = names.getArray(); - NameIndexHash::const_iterator it = namesToIndices.begin(); - NameIndexHash::const_iterator it_end = namesToIndices.end(); - for ( ; it != it_end; ++it, ++pString ) - *pString = it->first; - return names; + return comphelper::mapKeysToSequence( namesToIndices ); } virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (uno::RuntimeException, std::exception) override -- cgit v1.2.3