summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-28 02:58:37 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-29 10:36:50 +0100
commit6afc83865f77e572e9a04cc298ca5b0eab85af62 (patch)
treeeb2ae4be4efcddc42113a0dacbe44802ab000ca3 /sw/source/core/unocore
parent0729e946388c4cbf3dce2971ccad30290ce66497 (diff)
clean up and reduce indent levels
Change-Id: Idfc5ea5acf7f09046c92aa37ff01df29147cd738
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r--sw/source/core/unocore/unostyle.cxx42
1 files changed, 19 insertions, 23 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 2b321f4324e8..cebbdeeceb84 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -689,33 +689,29 @@ void SwXStyleFamily::replaceByName(const OUString& rName, const uno::Any& rEleme
throw( lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- if(m_pBasePool)
+ if(!m_pBasePool)
+ throw uno::RuntimeException();
+ m_pBasePool->SetSearchMask(m_eFamily);
+ SfxStyleSheetBase* pBase = m_pBasePool->Find(rName);
+ // replacements only for userdefined styles
+ if(!pBase)
+ throw container::NoSuchElementException();
+ if(!pBase->IsUserDefined())
+ throw lang::IllegalArgumentException();
+ //if theres an object available to this style then it must be invalidated
+ uno::Reference<style::XStyle> xStyle = _FindStyle(pBase->GetName());
+ if(xStyle.is())
{
- m_pBasePool->SetSearchMask(m_eFamily);
- SfxStyleSheetBase* pBase = m_pBasePool->Find(rName);
- // replacements only for userdefined styles
- if(!pBase)
- throw container::NoSuchElementException();
- if(!pBase->IsUserDefined())
- throw lang::IllegalArgumentException();
- //if theres an object available to this style then it must be invalidated
- uno::Reference< style::XStyle > xStyle = _FindStyle(pBase->GetName());
- if(xStyle.is())
+ uno::Reference<lang::XUnoTunnel> xTunnel( xStyle, uno::UNO_QUERY);
+ if(xTunnel.is())
{
- uno::Reference<lang::XUnoTunnel> xTunnel( xStyle, uno::UNO_QUERY);
- if(xTunnel.is())
- {
- SwXStyle* pStyle = reinterpret_cast< SwXStyle * >(
- sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( SwXStyle::getUnoTunnelId()) ));
- pStyle->Invalidate();
- }
+ SwXStyle* pStyle = reinterpret_cast< SwXStyle * >(
+ sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething( SwXStyle::getUnoTunnelId()) ));
+ pStyle->Invalidate();
}
-
- m_pBasePool->Remove(pBase);
- insertByName(rName, rElement);
}
- else
- throw uno::RuntimeException();
+ m_pBasePool->Remove(pBase);
+ insertByName(rName, rElement);
}
void SwXStyleFamily::removeByName(const OUString& rName) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception )