axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r905612 - /webservices/axis2/trunk/c/axiom/src/om/om_node.c
Date Tue, 02 Feb 2010 12:48:17 GMT
Author: shankar
Date: Tue Feb  2 12:48:16 2010
New Revision: 905612

URL: http://svn.apache.org/viewvc?rev=905612&view=rev
Log:
fixing the issue AXIS2C-1445

Modified:
    webservices/axis2/trunk/c/axiom/src/om/om_node.c

Modified: webservices/axis2/trunk/c/axiom/src/om/om_node.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_node.c?rev=905612&r1=905611&r2=905612&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_node.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_node.c Tue Feb  2 12:48:16 2010
@@ -16,6 +16,7 @@
  */
 
 #include "axiom_node_internal.h"
+#include "axiom_stax_builder_internal.h"
 #include <axiom_element.h>
 #include <axiom_text.h>
 #include <axiom_data_source.h>
@@ -268,8 +269,6 @@
 {
     axiom_node_t *parent = NULL;
 
-    AXIS2_ENV_CHECK(env, NULL);
-
     parent = om_node->parent;
     if(!parent)
     {
@@ -278,7 +277,7 @@
         return om_node;
     }
 
-    if(!(om_node->prev_sibling))
+    if(!om_node->prev_sibling)
     {
         parent->first_child = om_node->next_sibling;
     }
@@ -302,11 +301,24 @@
         }
     }
 
-    if((parent->last_child) && ((parent->last_child) == om_node))
+    if(parent->last_child && (parent->last_child == om_node))
     {
         parent->last_child = om_node->prev_sibling;
     }
 
+    if(om_node->builder && (axiom_stax_builder_get_lastnode(om_node->builder,
env) == om_node))
+    {
+        axiom_node_t *lastnode = parent;
+
+        /* if previous sibling is available, set that as the builder's last node. Else set
the
+         * parent as the last node */
+        if(om_node->prev_sibling)
+        {
+            lastnode = om_node->prev_sibling;
+        }
+        axiom_stax_builder_set_lastnode(om_node->builder, env, lastnode);
+    }
+
     om_node->parent = NULL;
     om_node->prev_sibling = NULL;
     om_node->next_sibling = NULL;
@@ -1302,7 +1314,6 @@
     const axutil_env_t * env,
     struct axiom_document * om_doc)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE);
     om_node->om_doc = om_doc;
     return AXIS2_SUCCESS;
@@ -1312,18 +1323,15 @@
  internal function only sets the builder reference ,
  should not be used by user
  */
-
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_node_set_builder(
     axiom_node_t * om_node,
     const axutil_env_t * env,
     axiom_stax_builder_t * builder)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, om_node, AXIS2_FAILURE);
     om_node->builder = builder;
     return AXIS2_SUCCESS;
-
 }
 
 /**



Mime
View raw message