| 763 | |
| 764 | |
| 765 | XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ) |
| 766 | { |
| 767 | TIXMLASSERT( addThis ); |
| 768 | if ( addThis->_document != _document ) { |
| 769 | TIXMLASSERT( false ); |
| 770 | return 0; |
| 771 | } |
| 772 | |
| 773 | TIXMLASSERT( afterThis ); |
| 774 | |
| 775 | if ( afterThis->_parent != this ) { |
| 776 | TIXMLASSERT( false ); |
| 777 | return 0; |
| 778 | } |
| 779 | |
| 780 | if ( afterThis->_next == 0 ) { |
| 781 | // The last node or the only node. |
| 782 | return InsertEndChild( addThis ); |
| 783 | } |
| 784 | InsertChildPreamble( addThis ); |
| 785 | addThis->_prev = afterThis; |
| 786 | addThis->_next = afterThis->_next; |
| 787 | afterThis->_next->_prev = addThis; |
| 788 | afterThis->_next = addThis; |
| 789 | addThis->_parent = this; |
| 790 | return addThis; |
| 791 | } |
| 792 | |
| 793 | |
| 794 |
nothing calls this directly
no outgoing calls
no test coverage detected