White spaces, coding style

This commit is contained in:
Marcelo Roberto Jimenez 2012-03-07 15:06:26 -03:00
parent 4c3532585d
commit c12d33aca6

View File

@ -233,55 +233,42 @@ int ixmlElement_setAttributeNode(
IXML_Node *preSib = NULL;
IXML_Node *nextSib = NULL;
if (element == NULL || newAttr == NULL) {
if (!element || !newAttr)
return IXML_INVALID_PARAMETER;
}
if (newAttr->n.ownerDocument != element->n.ownerDocument) {
if (newAttr->n.ownerDocument != element->n.ownerDocument)
return IXML_WRONG_DOCUMENT_ERR;
}
if (newAttr->ownerElement != NULL) {
if (newAttr->ownerElement)
return IXML_INUSE_ATTRIBUTE_ERR;
}
newAttr->ownerElement = element;
node = (IXML_Node *)newAttr;
attrNode = element->n.firstAttr;
while (attrNode != NULL) {
if (strcmp(attrNode->nodeName, node->nodeName) == 0) {
while (attrNode) {
if (!strcmp(attrNode->nodeName, node->nodeName))
/* Found it */
break;
} else {
else
attrNode = attrNode->nextSibling;
}
}
if (attrNode != NULL) {
if (attrNode) {
/* Already present, will replace by newAttr */
preSib = attrNode->prevSibling;
nextSib = attrNode->nextSibling;
if (preSib != NULL) {
if (preSib)
preSib->nextSibling = node;
}
if (nextSib != NULL) {
if (nextSib)
nextSib->prevSibling = node;
}
if (element->n.firstAttr == attrNode) {
if (element->n.firstAttr == attrNode)
element->n.firstAttr = node;
}
if (rtAttr != NULL) {
if (rtAttr)
*rtAttr = (IXML_Attr *)attrNode;
} else {
else
ixmlAttr_free((IXML_Attr *)attrNode);
}
} else {
/* Add this attribute */
if (element->n.firstAttr != NULL) {
if (element->n.firstAttr) {
prevAttr = element->n.firstAttr;
nextAttr = prevAttr->nextSibling;
while (nextAttr != NULL) {
while (nextAttr) {
prevAttr = nextAttr;
nextAttr = prevAttr->nextSibling;
}
@ -293,10 +280,8 @@ int ixmlElement_setAttributeNode(
node->prevSibling = NULL;
node->nextSibling = NULL;
}
if (rtAttr != NULL) {
if (rtAttr)
*rtAttr = NULL;
}
}
return IXML_SUCCESS;