xmllite/reader: Return empty value for elements.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-03-07 06:50:56 +03:00 committed by Alexandre Julliard
parent 7c44c65ebb
commit 70028b7d0a
2 changed files with 13 additions and 1 deletions

View File

@ -2244,6 +2244,7 @@ static HRESULT reader_parse_element(xmlreader *reader)
reader_set_strvalue(reader, StringValue_Prefix, &prefix);
reader_set_strvalue(reader, StringValue_LocalName, &local);
reader_set_strvalue(reader, StringValue_QualifiedName, &qname);
reader_set_strvalue(reader, StringValue_Value, &strval_empty);
break;
}
default:
@ -2899,6 +2900,7 @@ static HRESULT WINAPI xmlreader_MoveToElement(IXmlReader* iface)
reader_set_strvalue(This, StringValue_QualifiedName, &element->qname);
}
}
reader_set_strvalue(This, StringValue_Value, &strval_empty);
return S_OK;
}

View File

@ -909,7 +909,6 @@ todo_wine {
hr = IXmlReader_GetValue(reader, &val, NULL);
ok(hr == S_OK, "expected S_OK, got %08x\n", hr);
todo_wine
ok(*val == 0, "got %s\n", wine_dbgstr_w(val));
hr = IXmlReader_GetLocalName(reader, &val, NULL);
@ -1473,9 +1472,17 @@ static void test_read_element(void)
/* moving to attributes increases depth */
if (count)
{
const WCHAR *value;
hr = IXmlReader_GetValue(reader, &value, NULL);
ok(*value == 0, "Unexpected value %s\n", wine_dbgstr_w(value));
hr = IXmlReader_MoveToFirstAttribute(reader);
ok(hr == S_OK, "got %08x\n", hr);
hr = IXmlReader_GetValue(reader, &value, NULL);
ok(*value != 0, "Unexpected value %s\n", wine_dbgstr_w(value));
depth = 123;
hr = IXmlReader_GetDepth(reader, &depth);
ok(hr == S_OK, "got %08x\n", hr);
@ -1484,6 +1491,9 @@ static void test_read_element(void)
hr = IXmlReader_MoveToElement(reader);
ok(hr == S_OK, "got %08x\n", hr);
hr = IXmlReader_GetValue(reader, &value, NULL);
ok(*value == 0, "Unexpected value %s\n", wine_dbgstr_w(value));
depth = 123;
hr = IXmlReader_GetDepth(reader, &depth);
ok(hr == S_OK, "got %08x\n", hr);