From: dbv Date: Fri, 26 Oct 2018 15:04:25 +0000 (+0300) Subject: Fix X-Git-Tag: End2018~256 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=617ea412ed2a7196d941c2b272d4843f2f9b79b2;p=modules%2Fshaper.git Fix --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index b3357626f..7dc0453dd 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -1720,18 +1720,23 @@ ResultPtr Model_AttributeSelection::newestContext( aFindNewContext = false; // try to find the last context to find the up to date shape TopoDS_Shape aConShape = aResult->shape()->impl(); - Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aConShape, selectionLabel()); - if (!aNS.IsNull()) { - aNS = TNaming_Tool::CurrentNamedShape(aNS); - if (!aNS.IsNull() && isLater(selectionLabel(), aNS->Label()) && - isLater(aNS->Label(), std::dynamic_pointer_cast(aResult->data())->label())) { - TDF_Label aLab = aNS->Label(); - ResultPtr aRes = aDoc->resultByLab(aLab); - if (aRes.get()) { - if (theAnyValue || aRes->shape()->isSubShape(aSelectedShape)) { - aResult = aRes; - aFindNewContext = true; - continue; + if (TNaming_Tool::HasLabel(selectionLabel(), aConShape)) { + Handle(TNaming_NamedShape) aNS = TNaming_Tool::NamedShape(aConShape, selectionLabel()); + if (!aNS.IsNull()) { + aNS = TNaming_Tool::CurrentNamedShape(aNS); + if (!aNS.IsNull() + && isLater(selectionLabel(), aNS->Label()) + && isLater(aNS->Label(), + std::dynamic_pointer_cast(aResult->data())->label())) + { + TDF_Label aLab = aNS->Label(); + ResultPtr aRes = aDoc->resultByLab(aLab); + if (aRes.get()) { + if (theAnyValue || aRes->shape()->isSubShape(aSelectedShape)) { + aResult = aRes; + aFindNewContext = true; + continue; + } } } }