Commit 72187762 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Implement getValueFromQName() for MXAttributes.

parent 10a584a6
......@@ -1873,12 +1873,23 @@ static HRESULT WINAPI SAXAttributes_getValueFromName(ISAXAttributes *iface, cons
return E_NOTIMPL;
}
static HRESULT WINAPI SAXAttributes_getValueFromQName(ISAXAttributes *iface, const WCHAR * pQName,
int nQName, const WCHAR ** pValue, int * nValue)
static HRESULT WINAPI SAXAttributes_getValueFromQName(ISAXAttributes *iface, const WCHAR *qname,
int qname_len, const WCHAR **value, int *value_len)
{
mxattributes *This = impl_from_ISAXAttributes( iface );
FIXME("(%p)->(%s:%d %p %p): stub\n", This, debugstr_wn(pQName, nQName), nQName, pValue, nValue);
return E_NOTIMPL;
HRESULT hr;
int index;
TRACE("(%p)->(%s:%d %p %p)\n", This, debugstr_wn(qname, qname_len), qname_len, value, value_len);
if (!qname || !value || !value_len)
return (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3) ? E_POINTER : E_INVALIDARG;
hr = ISAXAttributes_getIndexFromQName(iface, qname, qname_len, &index);
if (hr == S_OK)
hr = ISAXAttributes_getValue(iface, index, value, value_len);
return hr;
}
static const ISAXAttributesVtbl SAXAttributesVtbl = {
......
......@@ -3437,6 +3437,40 @@ static void test_mxattr_addAttribute(void)
hr = ISAXAttributes_getIndexFromQName(saxattr, _bstr_(table->qname), strlen(table->qname)-1, &index);
EXPECT_HR(hr, E_INVALIDARG);
ok(index == -1, "%d: got wrong index %d\n", i, index);
if (IsEqualGUID(table->clsid, &CLSID_SAXAttributes40) ||
IsEqualGUID(table->clsid, &CLSID_SAXAttributes60))
{
hr = ISAXAttributes_getValueFromQName(saxattr, NULL, 0, NULL, NULL);
EXPECT_HR(hr, E_INVALIDARG);
hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, NULL, NULL);
EXPECT_HR(hr, E_INVALIDARG);
hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, &value, NULL);
EXPECT_HR(hr, E_INVALIDARG);
}
else
{
hr = ISAXAttributes_getValueFromQName(saxattr, NULL, 0, NULL, NULL);
EXPECT_HR(hr, E_POINTER);
hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, NULL, NULL);
EXPECT_HR(hr, E_POINTER);
hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, &value, NULL);
EXPECT_HR(hr, E_POINTER);
/* versions 4 and 6 crash */
hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), strlen(table->qname), NULL, NULL);
EXPECT_HR(hr, E_POINTER);
hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), strlen(table->qname), NULL, &len);
EXPECT_HR(hr, E_POINTER);
}
hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), strlen(table->qname), &value, &len);
EXPECT_HR(hr, S_OK);
}
len = -1;
......
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