summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-12-23 19:57:53 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-12-25 13:15:32 +0100
commitb025e60b8d00b0d8fbb694285eafb2c95b7b129e (patch)
treec852f4b7da734b4aa13e0d2ba575d9e6229995ae /sw
parentdc7879fe51f1db089a2be9b42548e7bc6d99c0b4 (diff)
refactor SwXStyle::isUserDefined/isInUse
Change-Id: I67d8408d410698f0f31738fcc30321c627307c73
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unostyle.cxx30
1 files changed, 9 insertions, 21 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 16313afe6dd3..9b8d860dc4bc 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1217,34 +1217,22 @@ void SwXStyle::setName(const OUString& rName) throw( uno::RuntimeException, std:
sal_Bool SwXStyle::isUserDefined() throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- bool bRet = false;
- if(m_pBasePool)
- {
- m_pBasePool->SetSearchMask(m_rEntry.m_eFamily);
- SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName);
- //if it is not found it must be non user defined
- if(pBase)
- bRet = pBase->IsUserDefined();
- }
- else
+ if(!m_pBasePool)
throw uno::RuntimeException();
- return bRet;
+ m_pBasePool->SetSearchMask(m_rEntry.m_eFamily);
+ SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName);
+ //if it is not found it must be non user defined
+ return pBase && pBase->IsUserDefined();
}
sal_Bool SwXStyle::isInUse() throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- bool bRet = false;
- if(m_pBasePool)
- {
- m_pBasePool->SetSearchMask(m_rEntry.m_eFamily, SFXSTYLEBIT_USED);
- SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName);
- if(pBase)
- bRet = pBase->IsUsed();
- }
- else
+ if(!m_pBasePool)
throw uno::RuntimeException();
- return bRet;
+ m_pBasePool->SetSearchMask(m_rEntry.m_eFamily, SFXSTYLEBIT_USED);
+ SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName);
+ return pBase && pBase->IsUsed();
}
OUString SwXStyle::getParentStyle() throw( uno::RuntimeException, std::exception )