diff options
author | Eike Rathke <erack@redhat.com> | 2018-01-26 13:41:09 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-01-26 13:42:35 +0100 |
commit | 707e0f4e6b6e36432c0f04f22719428a7e1a50ee (patch) | |
tree | e4cd89c4b79583ff3eb2d902a354fdd6d711d010 /sc/source/core/data/documen3.cxx | |
parent | fa3dc99fe354040aecfb64c4f5af49e313edfeef (diff) |
coverity#1428613 check IsValidReference() return value, tdf#108989 follow-up
Also remove the unnecessary continue;break; construct and just
return if found.
Change-Id: Ib32ff214a1a24ef3ad3c6f7f659a8b7fde6b2d4a
Diffstat (limited to 'sc/source/core/data/documen3.cxx')
-rw-r--r-- | sc/source/core/data/documen3.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index f7f8687ca4b2..e5262cd23d89 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -212,7 +212,6 @@ bool ScDocument::IsAddressInRangeName( RangeNameScope eScope, ScAddress& rAddres { ScRangeName* pRangeNames; ScRange aNameRange; - bool bRet = false; if (eScope == RangeNameScope::GLOBAL) pRangeNames= GetRangeName(); @@ -223,15 +222,14 @@ bool ScDocument::IsAddressInRangeName( RangeNameScope eScope, ScAddress& rAddres for (ScRangeName::iterator itr = itrBegin; itr != itrEnd; ++itr) { - itr->second->IsValidReference(aNameRange); - bRet = aNameRange.In(rAddress); - if (!bRet) - continue; - else - break; + if (itr->second->IsValidReference(aNameRange)) + { + if (aNameRange.In(rAddress)) + return true; + } } - return bRet; + return false; } bool ScDocument::InsertNewRangeName( const OUString& rName, const ScAddress& rPos, const OUString& rExpr ) |