summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore
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-24 00:03:46 +0100
commitcf25dad00c68e0c753b060737ba0eeab971f970f (patch)
tree85532e6d96688957d5a0176f1eea44ad61ab056a /sw/source/core/unocore
parent5abf0c5ba9e036c7979b21a3be07df6a69a41e55 (diff)
refactor SwXStyle::isUserDefined/isInUse
Change-Id: I67d8408d410698f0f31738fcc30321c627307c73
Diffstat (limited to 'sw/source/core/unocore')
-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 )