From 40e0802b94c179d9ec7fe73193132022e6055c99 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 29 Mar 2017 14:38:44 +0300 Subject: [PATCH] Fix the problem with TestFeaturesExtrusion.py test fail: correctly move the history line when the feature is moved. --- src/Model/Model_Document.cpp | 7 ++++--- src/ModelHighAPI/ModelHighAPI_Tools.cpp | 8 +++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index ce8386a2e..0eea8c4ff 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -918,22 +918,23 @@ void Model_Document::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis) // add it after all nested (otherwise the nested will be disabled) CompositeFeaturePtr aCompositeAfter = std::dynamic_pointer_cast(theAfterThis); + FeaturePtr anAfterThisSub = theAfterThis; if (aCompositeAfter.get()) { FeaturePtr aSub = aCompositeAfter; do { FeaturePtr aNext = myObjs->nextFeature(aSub); if (!isSub(aCompositeAfter, aNext)) { - theAfterThis = aSub; + anAfterThisSub = aSub; break; } aSub = aNext; } while (aSub.get()); } - myObjs->moveFeature(theMoved, theAfterThis); + myObjs->moveFeature(theMoved, anAfterThisSub); if (aCurrentUp) { // make the moved feature enabled or disabled due to the real status setCurrentFeature(currentFeature(false), false); - } else if (theAfterThis == currentFeature(false)) { + } else if (theAfterThis == currentFeature(false) || anAfterThisSub == currentFeature(false)) { // must be after move to make enabled all features which are before theMoved setCurrentFeature(theMoved, true); } diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.cpp b/src/ModelHighAPI/ModelHighAPI_Tools.cpp index c431fc9b6..75d782817 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Tools.cpp @@ -392,9 +392,15 @@ bool checkPythonDump() aDump->execute(); } bool isProblem = !aDump.get() || !aDump->error().empty(); // after "finish" dump will be removed + if (isProblem && aDump.get()) { + std::cout<<"Dump feature error "<error()<error()); + anErrorMsg.send(); + } aSession->finishOperation(); - if (isProblem) + if (isProblem) { return false; // something is wrong during dump + } // map from document name to feature name to feature data std::map > aStore; -- 2.39.2