]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the issue #3029 : Order of parameters is wrong, not as created
authormpv <mpv@opencascade.com>
Fri, 27 Sep 2019 12:31:15 +0000 (15:31 +0300)
committermpv <mpv@opencascade.com>
Fri, 27 Sep 2019 12:31:32 +0000 (15:31 +0300)
src/Model/Model_Document.cpp

index b7a295935dd09db70ae86de99417a1ea951a0b9c..be2877848b1a34b891a39b3dae19561fb94e780a 100644 (file)
@@ -1038,15 +1038,15 @@ FeaturePtr Model_Document::addFeature(std::string theID, const bool theMakeCurre
           aCurrent = aSub;
         }
       }
-      // #2861: if the parameter is added, add it after parameters existing in the list
-      if (aCurrent.get() &&
-          (aFeature->getKind() == "Parameter" || aFeature->getKind() == "ParametersMgr")) {
-        int anIndex = kUNDEFINED_FEATURE_INDEX;
-        for(FeaturePtr aNextFeat = myObjs->nextFeature(aCurrent, anIndex);
-            aNextFeat.get() && aNextFeat->getKind() == "Parameter";
-            aNextFeat = myObjs->nextFeature(aCurrent, anIndex))
-          aCurrent = aNextFeat;
-      }
+    }
+    // #2861,3029: if the parameter is added, add it after parameters existing in the list
+    if (aCurrent.get() &&
+      (aFeature->getKind() == "Parameter" || aFeature->getKind() == "ParametersMgr")) {
+      int anIndex = kUNDEFINED_FEATURE_INDEX;
+      for(FeaturePtr aNextFeat = myObjs->nextFeature(aCurrent, anIndex);
+        aNextFeat.get() && aNextFeat->getKind() == "Parameter";
+        aNextFeat = myObjs->nextFeature(aCurrent, anIndex))
+        aCurrent = aNextFeat;
     }
     aDocToAdd->myObjs->addFeature(aFeature, aCurrent);
     if (!aFeature->isAction()) {  // do not add action to the data model