From 2bb2a74d3111ae2f2eea10996c7e2b923b18d7cb Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 9 Aug 2013 12:04:38 +0000 Subject: [PATCH] Possibility to undo empty transactions. --- src/HYDROData/HYDROData_Document.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/HYDROData/HYDROData_Document.cxx b/src/HYDROData/HYDROData_Document.cxx index 6062fd6d..bfc30b84 100644 --- a/src/HYDROData/HYDROData_Document.cxx +++ b/src/HYDROData/HYDROData_Document.cxx @@ -133,7 +133,12 @@ void HYDROData_Document::StartOperation() void HYDROData_Document::CommitOperation(const TCollection_ExtendedString& theName) { - myDoc->CommitCommand(); + if( !myDoc->CommitCommand() ) // it means that there were no modifications done + { + myDoc->NewCommand(); + NewID(); // workaround: do something just to modify the document + myDoc->CommitCommand(); + } myTransactionsAfterSave++; if( theName.Length() != 0 ) -- 2.39.2