formatting tweaks
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index 7ecbf86..040a2a1 100755
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -638,6 +638,7 @@
if ( child->_next ) {
child->_next->_prev = child->_prev;
}
+ child->_parent = 0;
}
@@ -652,10 +653,12 @@
{
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 @@
{
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 @@
{
if (addThis->_document != _document)
return 0;
+
TIXMLASSERT( afterThis->_parent == this );
+
if ( afterThis->_parent != this ) {
return 0;
}