summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/documen3.cxx14
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 )