| 699 | |
| 700 | |
| 701 | XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ) |
| 702 | { |
| 703 | if (addThis->_document != _document) |
| 704 | return 0; |
| 705 | |
| 706 | TIXMLASSERT( afterThis->_parent == this ); |
| 707 | |
| 708 | if ( afterThis->_parent != this ) { |
| 709 | return 0; |
| 710 | } |
| 711 | |
| 712 | if ( afterThis->_next == 0 ) { |
| 713 | // The last node or the only node. |
| 714 | return InsertEndChild( addThis ); |
| 715 | } |
| 716 | if (addThis->_parent) |
| 717 | addThis->_parent->Unlink( addThis ); |
| 718 | else |
| 719 | addThis->_memPool->SetTracked(); |
| 720 | addThis->_prev = afterThis; |
| 721 | addThis->_next = afterThis->_next; |
| 722 | afterThis->_next->_prev = addThis; |
| 723 | afterThis->_next = addThis; |
| 724 | addThis->_parent = this; |
| 725 | return addThis; |
| 726 | } |
| 727 | |
| 728 | |
| 729 |
nothing calls this directly
no test coverage detected