From 36df4893bf8a54b1616ff53f022c221761731488 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Wed, 10 Feb 2016 15:02:04 +0100 Subject: [PATCH] webservices: Implement WS_MOVE_TO_PREVIOUS_ELEMENT in the reader. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/webservices/reader.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dlls/webservices/reader.c b/dlls/webservices/reader.c index e613a450bf9..19aa1af6e31 100644 --- a/dlls/webservices/reader.c +++ b/dlls/webservices/reader.c @@ -1362,6 +1362,24 @@ static BOOL move_to_next_element( struct reader *reader ) return FALSE; } +static BOOL move_to_prev_element( struct reader *reader ) +{ + struct list *ptr; + struct node *node = reader->current; + + while ((ptr = list_prev( &node->parent->children, &node->entry ))) + { + struct node *prev = LIST_ENTRY( ptr, struct node, entry ); + if (prev->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) + { + reader->current = prev; + return TRUE; + } + node = prev; + } + return FALSE; +} + static HRESULT read_move_to( struct reader *reader, WS_MOVE_TO move, BOOL *found ) { struct list *ptr; @@ -1383,6 +1401,10 @@ static HRESULT read_move_to( struct reader *reader, WS_MOVE_TO move, BOOL *found success = move_to_next_element( reader ); break; + case WS_MOVE_TO_PREVIOUS_ELEMENT: + success = move_to_prev_element( reader ); + break; + case WS_MOVE_TO_FIRST_NODE: if ((ptr = list_head( &reader->current->parent->children ))) {