diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-08-23 18:15:56 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-09-06 12:09:05 +0200 |
commit | fe2b2be9da0c34eb644fea57522c7dae1eab18aa (patch) | |
tree | c3e63dd350ebff90820cc56772ff68715d6f90d0 /sw | |
parent | 43bd90abe847d75de9cdfb94ad99b43aeb7bfbe1 (diff) |
Improve readability by early bailout
Change-Id: Ie6616f886d58c756df10ae917ced07c82cae7f61
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/tox/tox.cxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 7fc05c45824f..f0a24599bbe0 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -345,20 +345,23 @@ SwForm& SwForm::operator=(const SwForm& rForm) sal_uInt16 SwForm::GetFormMaxLevel( TOXTypes eTOXType ) { - sal_uInt16 nRet = 0; switch( eTOXType ) { - case TOX_INDEX: nRet = 5; break; - case TOX_USER: nRet = MAXLEVEL+1; break; - case TOX_CONTENT: nRet = MAXLEVEL+1; break; + case TOX_INDEX: + return 5; + case TOX_USER: + case TOX_CONTENT: + return MAXLEVEL + 1; case TOX_ILLUSTRATIONS: - case TOX_OBJECTS : - case TOX_TABLES : nRet = 2; break; - case TOX_BIBLIOGRAPHY : + case TOX_OBJECTS: + case TOX_TABLES: + return 2; + case TOX_BIBLIOGRAPHY: case TOX_CITATION: - case TOX_AUTHORITIES : nRet = AUTH_TYPE_END + 1; break; + case TOX_AUTHORITIES: + return AUTH_TYPE_END + 1; } - return nRet; + return 0; } void SwForm::AdjustTabStops( SwDoc& rDoc ) // #i21237# @@ -463,7 +466,7 @@ SwTOXBase& SwTOXBase::CopyTOXBase( SwDoc* pDoc, const SwTOXBase& rSource ) // type not in pDoc, so create it now const SwTOXTypes& rTypes = pDoc->GetTOXTypes(); bool bFound = false; - for( sal_uInt16 n = rTypes.size(); n; ) + for( size_t n = rTypes.size(); n; ) { const SwTOXType* pCmp = rTypes[ --n ]; if( pCmp->GetType() == pType->GetType() && |