From: mpv Date: Wed, 13 Feb 2019 11:13:52 +0000 (+0300) Subject: Fix for the issue #2861. This issue 2861 is not a regression, but caused by order... X-Git-Tag: V9_3_0a1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ef8794e9ab8985fc09219e3bcefdb2d069c49b6e;p=modules%2Fshaper.git Fix for the issue #2861. This issue 2861 is not a regression, but caused by order of parameters relative to other features. Here parameter l1 is created in sketch and when the sketch is current feature, new parameter was created just after, before l1. --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 2cbfce82c..337161e6f 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -1025,6 +1025,14 @@ 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") { + 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