diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index c3e94f9b999b..5e2ba64e9267 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -70,6 +70,7 @@ #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> +#include <comphelper/sequenceasvector.hxx> //UUUU #include <unobrushitemhelper.hxx> @@ -788,23 +789,22 @@ uno::Any SwXStyleFamily::getByName(const OUString& rName) uno::Sequence< OUString > SwXStyleFamily::getElementNames(void) throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - uno::Sequence< OUString > aRet; + comphelper::SequenceAsVector< OUString > aRet; if(pBasePool) { - SfxStyleSheetIteratorPtr pIterator = pBasePool->CreateIterator(eFamily, SFXSTYLEBIT_ALL); - const sal_uInt16 nCount = pIterator->Count(); - aRet.realloc(nCount); - OUString* pArray = aRet.getArray(); + SfxStyleSheetIteratorPtr pIt = pBasePool->CreateIterator(eFamily, SFXSTYLEBIT_ALL); OUString aString; - for(sal_uInt16 i = 0; i < nCount; i++) + for (SfxStyleSheetBase* pStyle = pIt->First(); pStyle; pStyle = pIt->Next()) { - SwStyleNameMapper::FillProgName((*pIterator)[i]->GetName(), aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), true ); - pArray[i] = aString; + SwStyleNameMapper::FillProgName(pStyle->GetName(), aString, + lcl_GetSwEnumFromSfxEnum ( eFamily ), true); + aRet.push_back(aString); } } else throw uno::RuntimeException(); - return aRet; + + return aRet.getAsConstList(); } sal_Bool SwXStyleFamily::hasByName(const OUString& rName) throw( uno::RuntimeException, std::exception ) |