From: mpv Date: Sun, 12 Nov 2017 13:02:27 +0000 (+0300) Subject: Avoid possible problem on the document delete or close (if results contain compsolids). X-Git-Tag: V_2.10.0RC~166 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=86c8fa707137efe87ce6fe95c39123a66ce82068;p=modules%2Fshaper.git Avoid possible problem on the document delete or close (if results contain compsolids). --- diff --git a/src/Model/Model_ResultBody.cpp b/src/Model/Model_ResultBody.cpp index f69c4d604..731a520de 100644 --- a/src/Model/Model_ResultBody.cpp +++ b/src/Model/Model_ResultBody.cpp @@ -47,7 +47,7 @@ void Model_ResultBody::colorConfigInfo(std::string& theSection, std::string& the bool Model_ResultBody::setDisabled(std::shared_ptr theThis, const bool theFlag) { bool aChanged = ModelAPI_ResultBody::setDisabled(theThis, theFlag); - if (aChanged) { // state is changed, so modifications are needed + if (aChanged && data()->isValid()) { // state is changed, so modifications are needed myBuilder->evolutionToSelection(theFlag); } return aChanged; diff --git a/src/ModelAPI/ModelAPI_Result.cpp b/src/ModelAPI/ModelAPI_Result.cpp index 4aac574bf..588d138bf 100644 --- a/src/ModelAPI/ModelAPI_Result.cpp +++ b/src/ModelAPI/ModelAPI_Result.cpp @@ -44,7 +44,8 @@ bool ModelAPI_Result::setDisabled(std::shared_ptr theThis, cons { if (myIsDisabled != theFlag) { myIsDisabled = theFlag; - data()->setIsDeleted(theFlag); // store it in data model (to get back on undo/redo, etc) + if (data()->isValid()) + data()->setIsDeleted(theFlag); // store it in data model (to get back on undo/redo, etc) // this must be before "updated" message send to have history updated for OB update document()->updateHistory(groupName()); // to update the history cash data in the document // generate related events