formatting tweaks

This commit is contained in:
Lee Thomason
2013-10-26 21:50:46 -07:00
parent ed52328ced
commit 3b7927efb5
2 changed files with 10 additions and 3 deletions

View File

@@ -638,6 +638,7 @@ void XMLNode::Unlink( XMLNode* child )
if ( child->_next ) {
child->_next->_prev = child->_prev;
}
child->_parent = 0;
}
@@ -652,10 +653,12 @@ XMLNode* XMLNode::InsertEndChild( XMLNode* addThis )
{
if (addThis->_document != _document)
return 0;
if (addThis->_parent)
addThis->_parent->Unlink( addThis );
else
addThis->_memPool->SetTracked();
if ( _lastChild ) {
TIXMLASSERT( _firstChild );
TIXMLASSERT( _lastChild->_next == 0 );
@@ -681,10 +684,12 @@ XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )
{
if (addThis->_document != _document)
return 0;
if (addThis->_parent)
addThis->_parent->Unlink( addThis );
else
addThis->_memPool->SetTracked();
if ( _firstChild ) {
TIXMLASSERT( _lastChild );
TIXMLASSERT( _firstChild->_prev == 0 );
@@ -711,7 +716,9 @@ XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis )
{
if (addThis->_document != _document)
return 0;
TIXMLASSERT( afterThis->_parent == this );
if ( afterThis->_parent != this ) {
return 0;
}