X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Document.cpp;h=d85fb7b292b9abcbdddf464d43ece287587726ac;hb=dc19b4c930a9c2cf5db509fc81586deab00e7417;hp=fe3d061bbeb119961ce427e006e34288a26338a9;hpb=5303dd1fa6ad4411e38f8d36103c72109957e05c;p=modules%2Fshaper.git diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index fe3d061bb..d85fb7b29 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -68,6 +68,8 @@ Model_Document::Model_Document(const std::string theID, const std::string theKin // in transaction for nesting correct working myDoc->NewCommand(); TDataStd_Integer::Set(myDoc->Main().Father(), 0); + // this to avoid creation of integer attribute outside the transaction after undo + transactionID(); myDoc->CommitCommand(); } @@ -278,6 +280,7 @@ void Model_Document::close(const bool theForever) // close all only if it is really asked, otherwise it can be undoed/redoed if (theForever) { + // flush everything to avoid messages with bad objects delete myObjs; myObjs = 0; if (myDoc->CanClose() == CDM_CCS_OK) @@ -512,7 +515,7 @@ void Model_Document::undoInternal(const bool theWithSubs, const bool theSynchron subDoc(*aSubIter)->undoInternal(theWithSubs, theSynchronize); } } - // after redo of all sub-documents to avoid updates on not-modified data (issue 370) + // after undo of all sub-documents to avoid updates on not-modified data (issue 370) if (theSynchronize) { myObjs->synchronizeFeatures(aDeltaLabels, true, isRoot()); // update the current features status @@ -659,6 +662,8 @@ void Model_Document::removeFeature(FeaturePtr theFeature) void Model_Document::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis) { myObjs->moveFeature(theMoved, theAfterThis); + if (theAfterThis == currentFeature(true)) + setCurrentFeature(theMoved, true); } void Model_Document::updateHistory(const std::shared_ptr theObject)