From: mpv Date: Fri, 16 Jan 2015 13:44:53 +0000 (+0300) Subject: Fix for the issue #294 : do not erase internal data structure of document on close... X-Git-Tag: V_1.0.0~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6858382d5642a83e6345a32bba1b8b74ec8144df;p=modules%2Fshaper.git Fix for the issue #294 : do not erase internal data structure of document on close: it may be undone --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 915ce9365..65d4cb70b 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -258,9 +258,15 @@ void Model_Document::close(const bool theForever) ModelAPI_EventCreator::get()->sendDeleted(aThis, ModelAPI_Feature::group()); ModelAPI_EventCreator::get()->sendUpdated(aFeature, EVENT_DISP); aFeature->eraseResults(); - aFeature->erase(); + if (theForever) { // issue #294: do not delete content of the document until it can be redone + aFeature->erase(); + } else { + aFeature->data()->execState(ModelAPI_StateMustBeUpdated); + } + } + if (theForever) { + myObjs.Clear(); } - myObjs.Clear(); aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED)); aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); @@ -461,7 +467,7 @@ void Model_Document::redo() subDoc(*aSubIter)->redo(); } -/// Appenad to the array of references a new referenced label +/// Append to the array of references a new referenced label static void AddToRefArray(TDF_Label& theArrayLab, TDF_Label& theReferenced) { Handle(TDataStd_ReferenceArray) aRefs;