App: record transaction on non DocumentObject

Related #0004265
This commit is contained in:
Zheng, Lei
2020-03-24 07:18:50 +08:00
committed by wwmayer
parent 95a0312275
commit f67d960146
2 changed files with 9 additions and 7 deletions

View File

@@ -1152,12 +1152,8 @@ void Document::_checkTransaction(DocumentObject* pcDelObj, const Property *What,
const char *name = GetApplication().getActiveTransaction(&tid);
if(name && tid>0) {
bool ignore = false;
if(What) {
auto parent = What->getContainer();
auto parentObj = Base::freecad_dynamic_cast<DocumentObject>(parent);
if(!parentObj || What->testStatus(Property::NoModify))
ignore = true;
}
if(What && What->testStatus(Property::NoModify))
ignore = true;
if(FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) {
if(What)
FC_LOG((ignore?"ignore":"auto") << " transaction ("