summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-19 09:14:59 +0200
committerNoel Grandin <noel@peralex.com>2015-11-19 09:33:29 +0200
commit2554efabb6d7cd2ad9f7cfdddd0712c25cdca1cd (patch)
tree1b8fd3940910ffcd328e16a53e208c099f67ab21 /stoc
parentf7b5f477bfd942e0a1d8880c372635000d724dd7 (diff)
use comphelper::containerToSequence
in chart2, we remove a local equivalent of the method Change-Id: I25129a3d1ea1dd724eb9cd38a57be37a78b3d100
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/implementationregistration/implreg.cxx15
-rw-r--r--stoc/source/servicemanager/servicemanager.cxx10
2 files changed, 4 insertions, 21 deletions
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 008991d91046..d15e4ee0d9b4 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -27,6 +27,7 @@
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/sequence.hxx>
#include <uno/mapping.hxx>
#include <osl/thread.h>
@@ -1633,19 +1634,7 @@ Sequence< OUString > ImplementationRegistration::getImplementations(
if (!implNames.empty())
{
- std::list<OUString>::const_iterator iter = implNames.begin();
-
- Sequence<OUString> seqImpl(implNames.size());
- OUString *pImplNames = seqImpl.getArray();
-
- sal_Int32 index = 0;
- while (iter != implNames.end())
- {
- pImplNames[index] = *iter;
- index++;
- ++iter;
- }
-
+ Sequence<OUString> seqImpl(comphelper::containerToSequence<OUString>(implNames));
xImpl->closeKey();
return seqImpl;
}
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 73c9ec1ab526..1fdf14f19a31 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -33,6 +33,7 @@
#include <cppuhelper/bootstrap.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/sequence.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
@@ -860,14 +861,7 @@ Sequence< OUString > OServiceManager::getUniqueAvailableServiceNames(
aNameSet.insert( (*aIt++).first );
*/
- Sequence< OUString > aNames( aNameSet.size() );
- OUString * pArray = aNames.getArray();
- sal_Int32 i = 0;
- HashSet_OWString::iterator next = aNameSet.begin();
- while( next != aNameSet.end() )
- pArray[i++] = (*next++);
-
- return aNames;
+ return comphelper::containerToSequence<OUString>(aNameSet);
}
// XMultiComponentFactory