sc/source/core/data/documen3.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
New commits: commit 707e0f4e6b6e36432c0f04f22719428a7e1a50ee Author: Eike Rathke <er...@redhat.com> Date: Fri Jan 26 13:41:09 2018 +0100 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 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 ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits