mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
* Source/NSXMLDocument.m
* Source/NSXMLElement.m: add code to insertChild:atIndex: to handle edge cases. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34569 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
14ac5c523f
commit
f81a39b90d
3 changed files with 43 additions and 9 deletions
|
@ -292,12 +292,18 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
|
|||
{
|
||||
prevNode = nextNode->prev;
|
||||
}
|
||||
else if(index > 0)
|
||||
{
|
||||
prevNode = (xmlNodePtr)[[self childAtIndex: index - 1] _node];
|
||||
}
|
||||
|
||||
// Make all of the links...
|
||||
/*
|
||||
if(prevNode != NULL)
|
||||
{
|
||||
prevNode->next = newNode;
|
||||
prevNode = nextNode;
|
||||
}
|
||||
*/
|
||||
newNode->next = nextNode;
|
||||
newNode->prev = prevNode;
|
||||
if(nextNode != NULL)
|
||||
|
@ -310,6 +316,7 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
|
|||
MY_DOC->children = newNode;
|
||||
}
|
||||
|
||||
((xmlNodePtr)[child _node])->parent = [self _node];
|
||||
GSIVar(child, parent) = self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue