summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unostyle.cxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-28 03:16:52 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-29 10:36:51 +0100
commit31f17b11c4c9b19f55d4f26c0c8eadef56d4ba62 (patch)
treed914cb0e71f14b78d3c0e306f94cf4791d364b17 /sw/source/core/unocore/unostyle.cxx
parent3f0d445874f4d5c057dd149dfc086d31efaf2669 (diff)
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.cxx26
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)