Commit cd7335ed authored by Jan Möbius's avatar Jan Möbius

Added some checks

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7939 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b35c711f
......@@ -412,12 +412,12 @@ BaseObject* BaseObject::parent()
/// Set the parent pointer
void BaseObject::setParent(BaseObject* _parent) {
// remove this child from the old parents list
if ( parentItem_ != 0 )
if ( parentItem_ != 0 ) {
parentItem_->removeChild(this);
// Add as child of new parent
if ( _parent != 0 )
_parent->appendChild(this);
if ( !_parent->childItems_.contains(this) )
_parent->appendChild(this);
}
// Store new parent
parentItem_ = _parent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment