Hans Leidekker : webservices: Implement WS_MOVE_TO_ROOT_ELEMENT in the reader.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 10 11:11:10 CST 2016


Module: wine
Branch: master
Commit: d2ecd8692a3d33a05e46d3bc985f6c75e8621f87
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d2ecd8692a3d33a05e46d3bc985f6c75e8621f87

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Feb 10 15:02:02 2016 +0100

webservices: Implement WS_MOVE_TO_ROOT_ELEMENT in the reader.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/webservices/reader.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c
index 664f183..87887ce 100644
--- a/dlls/webservices/reader.c
+++ b/dlls/webservices/reader.c
@@ -1319,6 +1319,31 @@ HRESULT WINAPI WsReadToStartElement( WS_XML_READER *handle, const WS_XML_STRING
     return read_to_startelement( reader, found );
 }
 
+static BOOL move_to_root_element( struct reader *reader )
+{
+    struct list *ptr;
+    struct node *node;
+
+    if (!(ptr = list_head( &reader->root->children ))) return FALSE;
+    node = LIST_ENTRY( ptr, struct node, entry );
+    if (node->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT)
+    {
+        reader->current = node;
+        return TRUE;
+    }
+    while ((ptr = list_next( &reader->root->children, &node->entry )))
+    {
+        struct node *next = LIST_ENTRY( ptr, struct node, entry );
+        if (next->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT)
+        {
+            reader->current = next;
+            return TRUE;
+        }
+        node = next;
+    }
+    return FALSE;
+}
+
 static HRESULT read_move_to( struct reader *reader, WS_MOVE_TO move, BOOL *found )
 {
     struct list *ptr;
@@ -1332,6 +1357,10 @@ static HRESULT read_move_to( struct reader *reader, WS_MOVE_TO move, BOOL *found
     }
     switch (move)
     {
+    case WS_MOVE_TO_ROOT_ELEMENT:
+        success = move_to_root_element( reader );
+        break;
+
     case WS_MOVE_TO_FIRST_NODE:
         if ((ptr = list_head( &reader->current->parent->children )))
         {




More information about the wine-cvs mailing list