]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix the problem with TestFeaturesExtrusion.py test fail: correctly move the history...
authormpv <mpv@opencascade.com>
Wed, 29 Mar 2017 11:38:44 +0000 (14:38 +0300)
committermpv <mpv@opencascade.com>
Wed, 29 Mar 2017 11:38:44 +0000 (14:38 +0300)
src/Model/Model_Document.cpp
src/ModelHighAPI/ModelHighAPI_Tools.cpp

index ce8386a2ef30547398597ecd3b3321697c0979bd..0eea8c4ffab630248643358d8c8a1f1c6dfefbc6 100755 (executable)
@@ -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<ModelAPI_CompositeFeature>(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);
   }
index c431fc9b65055b457a9b32e887fed528a742182b..75d782817df330b989b81a2d05cf52ce0b955162 100644 (file)
@@ -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 "<<aDump->error()<<std::endl;
+    Events_InfoMessage anErrorMsg(std::string("checkPythonDump"), aDump->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<std::string, std::map<std::string, ModelHighAPI_FeatureStore> > aStore;