Salome HOME
Issue #236: Avoid empty shape types definition
[modules/shaper.git] / src / ModuleBase / ModuleBase_Operation.cpp
index fa9183d31914f278f0addce86a44cbab52bbc6db..b3bf0b07572308f26b62a2fc2c177a4ae2eb24dc 100644 (file)
@@ -221,7 +221,13 @@ bool ModuleBase_Operation::commit()
     disconnect(myPropertyPanel, 0, this, 0);
 
     stopOperation();
-    ModelAPI_Session::get()->finishOperation();
+    // check whether there are modifications performed during the current operation
+    // in the model
+    // in case if there are no modifications, do not increase the undo/redo stack
+    if (ModelAPI_Session::get()->isModified())
+      ModelAPI_Session::get()->finishOperation();
+    else
+      ModelAPI_Session::get()->abortOperation();
 
     emit stopped();