better active part and document tip handling

This commit is contained in:
Stefan Tröger
2015-06-05 11:09:09 +02:00
parent d435e15a97
commit 7f80e711f6
5 changed files with 32 additions and 5 deletions

View File

@@ -2079,6 +2079,12 @@ void Document::remObject(const char* sName)
// Before deleting we must nullify all dependant objects
breakDependency(pos->second, true);
//and remove the tip if needed
if(Tip.getValue() && strcmp(Tip.getValue()->getNameInDocument(), sName)==0) {
Tip.setValue(nullptr);
TipName.setValue("");
}
// do no transactions if we do a rollback!
if(!d->rollback){
@@ -2122,6 +2128,12 @@ void Document::_remObject(DocumentObject* pcObject)
d->activeObject = 0;
signalDeletedObject(*pcObject);
//remove the tip if needed
if(Tip.getValue() == pcObject) {
Tip.setValue(nullptr);
TipName.setValue("");
}
// do no transactions if we do a rollback!
if(!d->rollback){