bool Model_ResultBody::setDisabled(std::shared_ptr<ModelAPI_Result> 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;
{
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