From 31be99a43f28c347bb52f6503ee1585348e4d582 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 18 Dec 2018 10:47:22 +0300 Subject: [PATCH] Fix for the issue #2813 : Parameters : error in model update due to the desactivation of the "auto-rebuild" --- src/Model/Model_Document.cpp | 3 --- src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 37e6b8bac..a8a82e1af 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -1035,7 +1035,6 @@ FeaturePtr Model_Document::addFeature(std::string theID, const bool theMakeCurre return aFeature; } - void Model_Document::refsToFeature(FeaturePtr theFeature, std::set >& theRefs, const bool isSendError) { @@ -1074,7 +1073,6 @@ static bool isSub(const CompositeFeaturePtr theMain, const FeaturePtr theSub) { return isSub(theMain, aParent); } - void Model_Document::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis) { bool aCurrentUp = theMoved == currentFeature(false); @@ -1460,7 +1458,6 @@ ResultPtr Model_Document::resultByLab(const TDF_Label& theLab) return ResultPtr(); // not found } - void Model_Document::addNamingName(const TDF_Label theLabel, std::string theName) { std::map >::iterator aFind = myNamingNames.find(theName); diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index d31439d40..56a65860d 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -298,6 +298,11 @@ bool ParametersPlugin_WidgetParamsMgr::storeValueCustom() } aId++; } + // #2813 : make the current feature the latest in the document + std::list allFeatures = myFeature->document()->allFeatures(); + if (!allFeatures.empty()) { + myFeature->document()->setCurrentFeature(*(allFeatures.rbegin()), true); + } return true; } -- 2.39.2