]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #302: correctly abort sketch transaction
authormpv <mikhail.ponikarov@opencascade.com>
Mon, 8 Dec 2014 07:16:17 +0000 (10:16 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Mon, 8 Dec 2014 07:16:17 +0000 (10:16 +0300)
src/Model/Model_Document.cpp

index 6c817c4b30fad1e75df83633028a9a18b0d6537d..62b157e04304a5053af5b200a58d2085f3cb2375 100644 (file)
@@ -338,8 +338,9 @@ void Model_Document::abortOperation()
 {
   if (myNestedNum > 0 && !myDoc->HasOpenCommand()) {  // abort all what was done in nested
       // first compact all nested
-    compactNested();
-    myDoc->Undo();
+    if (compactNested()) {
+      myDoc->Undo(); // undo only compacted, if not: do not undo the empty transaction
+    }
     myDoc->ClearRedos();
     myTransactionsAfterSave--;
     myIsEmptyTr.erase(myTransactionsAfterSave);