myIsEmptyTr[myTransactionsAfterSave] = false;
myTransactionsAfterSave++;
myDoc->NewCommand();
- } else { // start of simple command
+ } else { // start the simple command
myDoc->NewCommand();
}
// new command for all subs
}
void Model_Document::compactNested() {
+ bool allWasEmpty = true;
while(myNestedNum != -1) {
myTransactionsAfterSave--;
+ if (!myIsEmptyTr[myTransactionsAfterSave]) {
+ allWasEmpty = false;
+ }
myIsEmptyTr.erase(myTransactionsAfterSave);
myNestedNum--;
}
- myIsEmptyTr[myTransactionsAfterSave] = false;
+ myIsEmptyTr[myTransactionsAfterSave] = allWasEmpty;
myTransactionsAfterSave++;
myDoc->PerformDeltaCompaction();
}
}
} else {
// returns false if delta is empty and no transaction was made
- myIsEmptyTr[myTransactionsAfterSave] = !myDoc->CommitCommand() && (myNestedNum == -1);
+ myIsEmptyTr[myTransactionsAfterSave] = !myDoc->CommitCommand();// && (myNestedNum == -1);
myTransactionsAfterSave++;
}
std::list<boost::shared_ptr<ModelAPI_Result> >::const_iterator aRIter = aResults.begin();
for(; aRIter != aResults.cend(); aRIter++) {
boost::shared_ptr<ModelAPI_Result> aRes = *aRIter;
- aRes->setData(boost::shared_ptr<ModelAPI_Data>()); // deleted flag
+ //aRes->setData(boost::shared_ptr<ModelAPI_Data>()); // deleted flag
ModelAPI_EventCreator::get()->sendUpdated(aRes, EVENT_DISP);
ModelAPI_EventCreator::get()->sendDeleted(aThis, aRes->groupName());
}
+ // redisplay also removed feature (used for sketch and AISObject)
+ ModelAPI_EventCreator::get()->sendUpdated(aFeature, EVENT_DISP);
} else aFIter.Next();
}
if (theMarkUpdated)
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
boost::static_pointer_cast<Model_PluginManager>(Model_PluginManager::get())->
setCheckTransactions(true);
}
/// Returns the data manager of this object: attributes
virtual boost::shared_ptr<ModelAPI_Data> data() {return myData;}
- /// Returns true if feature refers to the same data model instance
+ /// Returns true if object refers to the same data model instance
virtual bool isSame(const boost::shared_ptr<ModelAPI_Object>& theObject)
{return theObject.get() == this;}