diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-28 03:16:52 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-11-28 23:59:16 +0100 |
commit | 6dc570598e2a0b49184d6cba88a31a28da76d56b (patch) | |
tree | 11f3e16fcbece403ce8a110d1ed5944da8eaa5eb /sw/source/core/unocore/unostyle.cxx | |
parent | simplify (diff) | |
download | core-6dc570598e2a0b49184d6cba88a31a28da76d56b.tar.gz core-6dc570598e2a0b49184d6cba88a31a28da76d56b.zip |
clean up and reduce indent levels
Change-Id: Ic96a95a3263c1b10c33e79f5fee19e7bf06498c9
Diffstat (limited to 'sw/source/core/unocore/unostyle.cxx')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index f684a592658f..dae662ef4394 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -736,27 +736,13 @@ void SAL_CALL SwXStyleFamily::setPropertyValue( const OUString&, const uno::Any& uno::Any SAL_CALL SwXStyleFamily::getPropertyValue( const OUString& sPropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception) { - uno::Any aRet; - - if ( sPropertyName == "DisplayName" ) - { - SolarMutexGuard aGuard; - const auto pEntry = std::find_if(our_vStyleFamilyEntries.begin(), our_vStyleFamilyEntries.end(), - [this] (const StyleFamilyEntry& e) { return m_eFamily == e.m_eFamily; }); - if(pEntry == our_vStyleFamilyEntries.end()) - OSL_FAIL( "SwXStyleFamily::getPropertyValue(): invalid family" ); - sal_uInt32 nResId = pEntry->m_nRedId; - if ( nResId > 0 ) - { - aRet = uno::makeAny( SW_RESSTR( nResId ) ); - } - } - else - { + if(sPropertyName != "DisplayName") throw beans::UnknownPropertyException( "unknown property: " + sPropertyName, static_cast<OWeakObject *>(this) ); - } - - return aRet; + SolarMutexGuard aGuard; + const auto pEntry = std::find_if(our_vStyleFamilyEntries.begin(), our_vStyleFamilyEntries.end(), + [this] (const StyleFamilyEntry& e) { return m_eFamily == e.m_eFamily; }); + assert(pEntry != our_vStyleFamilyEntries.end()); // invalid family + return uno::makeAny(SW_RESSTR(pEntry->m_nRedId)); } void SAL_CALL SwXStyleFamily::addPropertyChangeListener( const OUString&, const uno::Reference< beans::XPropertyChangeListener >& ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception) |