From: mpv Date: Tue, 26 May 2015 07:11:53 +0000 (+0300) Subject: Fix for create parameter, edit parameter, abort: constructions disappeared. X-Git-Tag: V_1.2.0~89 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7607e07dbc85f2058dbbfaa3d94985c9ae28c965;p=modules%2Fshaper.git Fix for create parameter, edit parameter, abort: constructions disappeared. --- 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();