Commit e2ae7ccb authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

xmllite: Increase depth in reader_set_current_attribute().

parent e97ef040
......@@ -2931,6 +2931,8 @@ static HRESULT WINAPI xmlreader_GetNodeType(IXmlReader* iface, XmlNodeType *node
static void reader_set_current_attribute(xmlreader *reader, struct attribute *attr)
{
if (!reader->attr)
reader_inc_depth(reader);
reader->attr = attr;
reader->chunk_read_off = 0;
reader_set_strvalue(reader, StringValue_Prefix, &attr->prefix);
......@@ -2943,9 +2945,6 @@ static HRESULT reader_move_to_first_attribute(xmlreader *reader)
if (!reader->attr_count)
return S_FALSE;
if (!reader->attr)
reader_inc_depth(reader);
reader_set_current_attribute(reader, LIST_ENTRY(list_head(&reader->attrs), struct attribute, entry));
return S_OK;
......
......@@ -2592,17 +2592,17 @@ static void test_attribute_by_name(void)
hr = IXmlReader_MoveToAttributeByName(reader, L"xmlns", xmlns_uriW);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine TEST_DEPTH(reader, 2);
TEST_DEPTH(reader, 2);
reader_value(reader, L"myns");
hr = IXmlReader_MoveToAttributeByName(reader, L"a", NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine TEST_DEPTH(reader, 2);
TEST_DEPTH(reader, 2);
reader_value(reader, L"value a");
hr = IXmlReader_MoveToAttributeByName(reader, L"b", NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine TEST_DEPTH(reader, 2);
TEST_DEPTH(reader, 2);
reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, L"a", L"myns");
......@@ -2613,22 +2613,22 @@ static void test_attribute_by_name(void)
hr = IXmlReader_MoveToAttributeByName(reader, L"ns", xmlns_uriW);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine TEST_DEPTH(reader, 2);
TEST_DEPTH(reader, 2);
reader_value(reader, L"ns uri");
hr = IXmlReader_MoveToAttributeByName(reader, L"b", L"");
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine TEST_DEPTH(reader, 2);
TEST_DEPTH(reader, 2);
reader_value(reader, L"value b");
hr = IXmlReader_MoveToAttributeByName(reader, L"c", NULL);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine TEST_DEPTH(reader, 2);
TEST_DEPTH(reader, 2);
reader_value(reader, L"value c2");
hr = IXmlReader_MoveToAttributeByName(reader, L"c", L"ns uri");
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine TEST_DEPTH(reader, 2);
TEST_DEPTH(reader, 2);
reader_value(reader, L"value c");
IXmlReader_Release(reader);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment