X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSelector%2FSelector_Modify.cpp;h=686e7cd5a8eefe4d864c0c55ed2047c3c6dfcf0b;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=98d1337191e88ce4dde95ff2dac5c91493f067fc;hpb=380f01e1fce1a012267d604a1190d04bf4659447;p=modules%2Fshaper.git diff --git a/src/Selector/Selector_Modify.cpp b/src/Selector/Selector_Modify.cpp index 98d133719..686e7cd5a 100644 --- a/src/Selector/Selector_Modify.cpp +++ b/src/Selector/Selector_Modify.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2020 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -152,17 +152,18 @@ bool Selector_Modify::select(NCollection_List& theMo const TopoDS_Shape theContext, const TopoDS_Shape theValue) { if (theModifList.Extent() > 1) { // searching for the best modification result: by context + bool isFound = false; Handle(TNaming_NamedShape) aCandidate; NCollection_List::Iterator aModIter(theModifList); - for (; !theModifList.IsEmpty() && aModIter.More(); aModIter.Next()) { + for (; aModIter.More() && !isFound; aModIter.Next()) { aCandidate = aModIter.Value(); TDF_Label aFatherLab = aCandidate->Label().Father(); Handle(TNaming_NamedShape) aFatherNS; if (aFatherLab.FindAttribute(TNaming_NamedShape::GetID(), aFatherNS)) { - for (TNaming_Iterator anIter(aFatherNS); anIter.More(); anIter.Next()) { + for (TNaming_Iterator anIter(aFatherNS); + anIter.More() && !isFound; anIter.Next()) { if (theContext.IsSame(anIter.NewShape())) { // found the best modification - theModifList.Clear(); - break; + isFound = true; } } }