From d63aa3e66ea4f15430a40d80d9ecd0c87b557e7e Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 17 Oct 2019 12:01:37 +0300 Subject: [PATCH] Revert "Issue #3044: Undo list contains empty string for Load python script" This reverts commit b82b4aecbd6ccaebeafbf409b8da515e4fea2543. --- src/Model/Model_Document.cpp | 7 ------- src/Model/Model_Document.h | 2 -- src/Model/Model_Session.cpp | 5 ----- src/Model/Model_Session.h | 2 -- src/ModelAPI/ModelAPI_Session.h | 2 -- src/ModelHighAPI/ModelHighAPI_Services.cpp | 2 -- 6 files changed, 20 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 7bf6290be..be2877848 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -852,13 +852,6 @@ bool Model_Document::isModified() return myTransactions.size() != myTransactionSave || isOperation(); } -void Model_Document::clearUndos() -{ - myDoc->ClearUndos(); - myTransactions.clear(); - myRedos.clear(); -} - bool Model_Document::canUndo() { // issue 406 : if transaction is opened, but nothing to undo behind, can not undo diff --git a/src/Model/Model_Document.h b/src/Model/Model_Document.h index 457a8717b..72a570738 100644 --- a/src/Model/Model_Document.h +++ b/src/Model/Model_Document.h @@ -85,8 +85,6 @@ class Model_Document : public ModelAPI_Document MODEL_EXPORT virtual bool canUndo(); //! Undoes last operation MODEL_EXPORT virtual void undo(); - //! Clean the undo list - MODEL_EXPORT virtual void clearUndos(); //! Returns True if there are available Redo-s MODEL_EXPORT virtual bool canRedo(); //! Redoes last operation diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index 4ccc8f1b7..89f90ee4a 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -143,11 +143,6 @@ bool Model_Session::isModified() return ROOT_DOC->isModified(); } -void Model_Session::clearUndos() -{ - ROOT_DOC->clearUndos(); -} - bool Model_Session::canUndo() { return ROOT_DOC->canUndo(); diff --git a/src/Model/Model_Session.h b/src/Model/Model_Session.h index 2ffc8d1bb..b480a67e9 100644 --- a/src/Model/Model_Session.h +++ b/src/Model/Model_Session.h @@ -87,8 +87,6 @@ class Model_Session : public ModelAPI_Session, public Events_Listener MODEL_EXPORT virtual bool canUndo(); //! Undoes last operation MODEL_EXPORT virtual void undo(); - //! Clean the undo list - MODEL_EXPORT virtual void clearUndos(); //! Returns True if there are available Redos MODEL_EXPORT virtual bool canRedo(); //! Redoes last operation diff --git a/src/ModelAPI/ModelAPI_Session.h b/src/ModelAPI/ModelAPI_Session.h index 8955bcb03..84a925aa2 100644 --- a/src/ModelAPI/ModelAPI_Session.h +++ b/src/ModelAPI/ModelAPI_Session.h @@ -78,8 +78,6 @@ class MODELAPI_EXPORT ModelAPI_Session virtual bool canUndo() = 0; //! Undoes last operation virtual void undo() = 0; - //! Clean the undo list - virtual void clearUndos() = 0; //! Returns True if there are available Redos virtual bool canRedo() = 0; //! Redoes last operation diff --git a/src/ModelHighAPI/ModelHighAPI_Services.cpp b/src/ModelHighAPI/ModelHighAPI_Services.cpp index 21ab68248..98f7aff84 100644 --- a/src/ModelHighAPI/ModelHighAPI_Services.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Services.cpp @@ -116,8 +116,6 @@ void end() } ModelAPI_Session::get()->finishOperation(); - // issue #3044: clear undo/redo lists - ModelAPI_Session::get()->clearUndos(); // to update data tree in the end of dumped script execution ModelAPI_EventCreator::get()->sendReordered(FeaturePtr()); } -- 2.39.2