Salome HOME
Fix for the issue #2401
[modules/shaper.git] / src / PartSet / PartSet_SketcherReentrantMgr.cpp
index eb524325c96653b8ecf5f50333cea99d89807747..b0d19549b987d7aab87e7248646d2a6fd2642ef9 100644 (file)
@@ -365,15 +365,20 @@ void PartSet_SketcherReentrantMgr::onNoMoreWidgets(const std::string& thePreviou
     return;
 
   if (aFOperation && module()->sketchMgr()->isNestedSketchOperation(aFOperation)) {
-    bool isStarted = false;
-    if (!module()->sketchMgr()->sketchSolverError()) {
-      if (myRestartingMode != RM_Forbided) {
-        myRestartingMode = RM_LastFeatureUsed;
-        isStarted = startInternalEdit(thePreviousAttributeID);
+    if (aFOperation->isNeedToBeAborted()) {
+      aFOperation->abort();
+    }
+    else {
+      bool isStarted = false;
+      if (!module()->sketchMgr()->sketchSolverError()) {
+        if (myRestartingMode != RM_Forbided) {
+          myRestartingMode = RM_LastFeatureUsed;
+          isStarted = startInternalEdit(thePreviousAttributeID);
+        }
       }
+      if (!isStarted)
+        aFOperation->commit();
     }
-    if (!isStarted)
-      aFOperation->commit();
   }
 }