Hans Leidekker : webservices: Implement WS_MOVE_TO_NEXT_ELEMENT in the reader.

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


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

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

webservices: Implement WS_MOVE_TO_NEXT_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 | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c
index 87887ce..e613a45 100644
--- a/dlls/webservices/reader.c
+++ b/dlls/webservices/reader.c
@@ -1344,6 +1344,24 @@ static BOOL move_to_root_element( struct reader *reader )
     return FALSE;
 }
 
+static BOOL move_to_next_element( struct reader *reader )
+{
+    struct list *ptr;
+    struct node *node = reader->current;
+
+    while ((ptr = list_next( &node->parent->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;
@@ -1361,6 +1379,10 @@ static HRESULT read_move_to( struct reader *reader, WS_MOVE_TO move, BOOL *found
         success = move_to_root_element( reader );
         break;
 
+    case WS_MOVE_TO_NEXT_ELEMENT:
+        success = move_to_next_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