0000706: copy- paste- crash

This commit is contained in:
wmayer
2012-06-03 16:36:00 +02:00
parent 4e58856735
commit 08bfa1465f
3 changed files with 23 additions and 15 deletions

View File

@@ -830,9 +830,14 @@ void DocumentItem::slotChangeObject(const Gui::ViewProviderDocumentObject& view)
children.insert(kt->second);
QTreeWidgetItem* parent = kt->second->parent();
if (parent && parent != it->second) {
int index = parent->indexOfChild(kt->second);
parent->takeChild(index);
it->second->addChild(kt->second);
if (it->second != kt->second) {
int index = parent->indexOfChild(kt->second);
parent->takeChild(index);
it->second->addChild(kt->second);
}
else {
Base::Console().Warning("Gui::DocumentItem::slotChangedObject(): Object references to itself.\n");
}
}
}
else {