Kaydet (Commit) 707e0f4e authored tarafından Eike Rathke's avatar Eike Rathke

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
üst fa3dc99f
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment