From: dbv Date: Fri, 26 Oct 2018 15:04:25 +0000 (+0300) Subject: Fix X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=be8ac9cd88a14cdefc35f764e5e692a95b346869;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; + } } } }