diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-28 02:36:28 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-28 23:59:08 +0100 |
commit | 126119d7aa721e1b29e37a3ab903734a3ecc5640 (patch) | |
tree | ea2866e72d37b6b7f9e57e4f2d80320d17abd132 | |
parent | clean up and reduce indent levels, remove hugely scoped Any (diff) | |
download | core-126119d7aa721e1b29e37a3ab903734a3ecc5640.tar.gz core-126119d7aa721e1b29e37a3ab903734a3ecc5640.zip |
clean up and reduce indent levels
Change-Id: I7c39a5a93c92fe6730a544ac2db8d17ef38c5545
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 25 |
1 files 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<OUString> SwXStyleFamily::getElementNames() throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - std::vector< OUString > aRet; - if(m_pBasePool) + if(!m_pBasePool) + throw uno::RuntimeException(); + std::vector<OUString> 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 ) |