From 7607e07dbc85f2058dbbfaa3d94985c9ae28c965 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 26 May 2015 10:11:53 +0300 Subject: [PATCH] Fix for create parameter, edit parameter, abort: constructions disappeared. --- src/Model/Model_Document.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 5b379c982..6c23dcbbe 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -653,17 +653,6 @@ void Model_Document::setCurrentFeature(std::shared_ptr theCurr TDF_Label aRefLab = generalLabel().FindChild(TAG_CURRENT_FEATURE); CompositeFeaturePtr aMain; // main feature that may nest the new current if (theCurrent.get()) { - /* - if (theVisible) { // make features below which are not in history also enabled: sketch subs - FeaturePtr aNext = myObjs->nextFeature(theCurrent); - for (; aNext.get(); aNext = myObjs->nextFeature(theCurrent)) { - if (aNext->isInHistory()) { - break; // next in history is not needed - } else { // next not in history is good for making current - theCurrent = aNext; - } - } - }*/ aMain = std::dynamic_pointer_cast(theCurrent); if (!aMain.get()) { // if feature nests into compisite feature, make the composite feature as current @@ -678,7 +667,20 @@ void Model_Document::setCurrentFeature(std::shared_ptr theCurr } } } + } + if (theVisible) { // make features below which are not in history also enabled: sketch subs + FeaturePtr aNext = + theCurrent.get() ? myObjs->nextFeature(theCurrent) : myObjs->firstFeature(); + for (; aNext.get(); aNext = myObjs->nextFeature(theCurrent)) { + if (aNext->isInHistory()) { + break; // next in history is not needed + } else { // next not in history is good for making current + theCurrent = aNext; + } + } + } + if (theCurrent.get()) { std::shared_ptr aData = std::static_pointer_cast(theCurrent->data()); if (!aData.get()) return; // unknown case TDF_Label aFeatureLabel = aData->label().Father(); -- 2.39.2