From 617ea412ed2a7196d941c2b272d4843f2f9b79b2 Mon Sep 17 00:00:00 2001 From: dbv Date: Fri, 26 Oct 2018 18:04:25 +0300 Subject: [PATCH] Fix --- src/Model/Model_AttributeSelection.cpp | 29 +++++++++++++++----------- 1 file changed, 17 insertions(+), 12 deletions(-) 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; + } } } } -- 2.39.2