Salome HOME
Fix for the issue #2813 : Parameters : error in model update due to the desactivation...
authormpv <mpv@opencascade.com>
Tue, 18 Dec 2018 07:47:22 +0000 (10:47 +0300)
committermpv <mpv@opencascade.com>
Tue, 18 Dec 2018 07:47:22 +0000 (10:47 +0300)
src/Model/Model_Document.cpp
src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp

index 37e6b8bac9e00698b70c410b9cbe912aa2e34183..a8a82e1af680f5f0dfbfc2c1897a32eed5e30013 100755 (executable)
@@ -1035,7 +1035,6 @@ FeaturePtr Model_Document::addFeature(std::string theID, const bool theMakeCurre
   return aFeature;
 }
 
-
 void Model_Document::refsToFeature(FeaturePtr theFeature,
   std::set<std::shared_ptr<ModelAPI_Feature> >& 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<std::string, std::list<TDF_Label> >::iterator aFind = myNamingNames.find(theName);
index d31439d406c56b3631f462df94793bca4593a831..56a65860d70b924519c55990386074129dfb1c43 100644 (file)
@@ -298,6 +298,11 @@ bool ParametersPlugin_WidgetParamsMgr::storeValueCustom()
     }
     aId++;
   }
+  // #2813 : make the current feature the latest in the document
+  std::list<FeaturePtr> allFeatures = myFeature->document()->allFeatures();
+  if (!allFeatures.empty()) {
+    myFeature->document()->setCurrentFeature(*(allFeatures.rbegin()), true);
+  }
   return true;
 }