X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Document.cpp;h=ec071b40300a35ca2d586f902764a204002897ed;hb=b2a662eec6a0258d51a67ee7e341541e7a710752;hp=a5598b6a5d5cb28d6e7ce7b006e0447cf198a939;hpb=35198d47407679a0b26291bf6a18cecf58398348;p=modules%2Fshaper.git diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index a5598b6a5..ec071b403 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -295,6 +295,10 @@ void Model_Document::close(const bool theForever) mySelectionFeature.reset(); } else { setCurrentFeature(FeaturePtr(), false); // disables all features + // update the OB: features are disabled (on remove of Part) + Events_Loop* aLoop = Events_Loop::loop(); + static Events_ID aDeleteEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED); + aLoop->flush(aDeleteEvent); } std::static_pointer_cast(Model_Session::get())->setCheckTransactions(true); @@ -577,9 +581,9 @@ void Model_Document::abortOperation() if (!myNestedNum.empty()) (*myNestedNum.rbegin())--; // roll back the needed number of transactions - // make commit/undo to get the modification delta //myDoc->AbortCommand(); - if (myDoc->CommitCommand()) { + // instead of abort, do commit and undo: to get the delta of modifications + if (myDoc->CommitCommand()) { modifiedLabels(myDoc, aDeltaLabels); myDoc->Undo(); } @@ -866,6 +870,8 @@ const int Model_Document::index(std::shared_ptr theObject) int Model_Document::size(const std::string& theGroupID) { + if (myObjs == 0) // may be on close + return 0; return myObjs->size(theGroupID); }