From cd97c5ee6be5820585e63d0fff2c9722836f6035 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Sat, 28 Nov 2015 02:36:28 +0100 Subject: clean up and reduce indent levels Change-Id: I7c39a5a93c92fe6730a544ac2db8d17ef38c5545 --- sw/source/core/unocore/unostyle.cxx | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index e3f14289c160..640b5c14bf52 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -602,25 +602,20 @@ uno::Any SwXStyleFamily::getByName(const OUString& rName) return uno::makeAny(xStyle); } -uno::Sequence< OUString > SwXStyleFamily::getElementNames() throw( uno::RuntimeException, std::exception ) +uno::Sequence SwXStyleFamily::getElementNames() throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - std::vector< OUString > aRet; - if(m_pBasePool) + if(!m_pBasePool) + throw uno::RuntimeException(); + std::vector vRet; + SfxStyleSheetIteratorPtr pIt = m_pBasePool->CreateIterator(m_eFamily, SFXSTYLEBIT_ALL); + for (SfxStyleSheetBase* pStyle = pIt->First(); pStyle; pStyle = pIt->Next()) { - SfxStyleSheetIteratorPtr pIt = m_pBasePool->CreateIterator(m_eFamily, SFXSTYLEBIT_ALL); - OUString aString; - for (SfxStyleSheetBase* pStyle = pIt->First(); pStyle; pStyle = pIt->Next()) - { - SwStyleNameMapper::FillProgName(pStyle->GetName(), aString, - lcl_GetSwEnumFromSfxEnum ( m_eFamily ), true); - aRet.push_back(aString); - } + OUString sName; + SwStyleNameMapper::FillProgName(pStyle->GetName(), sName, lcl_GetSwEnumFromSfxEnum(m_eFamily), true); + vRet.push_back(sName); } - else - throw uno::RuntimeException(); - - return comphelper::containerToSequence(aRet); + return comphelper::containerToSequence(vRet); } sal_Bool SwXStyleFamily::hasByName(const OUString& rName) throw( uno::RuntimeException, std::exception ) -- cgit