Commit 2ce0f8fd authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Fix collection index based support for IXMLDOMSelection.

parent 70e0290d
......@@ -185,13 +185,10 @@ static HRESULT WINAPI domselection_GetTypeInfo(
ITypeInfo** ppTInfo )
{
domselection *This = impl_from_IXMLDOMSelection( iface );
HRESULT hr;
TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
hr = get_typeinfo(IXMLDOMSelection_tid, ppTInfo);
return hr;
return get_typeinfo(IXMLDOMSelection_tid, ppTInfo);
}
static HRESULT WINAPI domselection_GetIDsOfNames(
......@@ -606,7 +603,6 @@ static HRESULT create_enumvariant(IXMLDOMSelection *selection, BOOL own, IUnknow
static HRESULT domselection_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
{
domselection *This = impl_from_IXMLDOMSelection( (IXMLDOMSelection*)iface );
WCHAR *ptr;
int idx = 0;
......@@ -615,9 +611,6 @@ static HRESULT domselection_get_dispid(IUnknown *iface, BSTR name, DWORD flags,
if(*ptr)
return DISP_E_UNKNOWNNAME;
if(idx >= xmlXPathNodeSetGetLength(This->result->nodesetval))
return DISP_E_UNKNOWNNAME;
*dispid = DISPID_DOM_COLLECTION_BASE + idx;
TRACE("ret %x\n", *dispid);
return S_OK;
......
......@@ -9999,10 +9999,12 @@ static void test_selection(void)
IEnumVARIANT *enum1, *enum2, *enum3;
IXMLDOMNodeList *list;
IXMLDOMDocument *doc;
IDispatchEx *dispex;
IXMLDOMNode *node;
IDispatch *disp;
VARIANT_BOOL b;
HRESULT hr;
DISPID did;
VARIANT v;
BSTR name;
ULONG ret;
......@@ -10020,6 +10022,22 @@ static void test_selection(void)
EXPECT_HR(hr, S_OK);
IXMLDOMSelection_Release(selection);
/* collection disp id */
hr = IXMLDOMSelection_QueryInterface(selection, &IID_IDispatchEx, (void**)&dispex);
EXPECT_HR(hr, S_OK);
did = 0;
hr = IDispatchEx_GetDispID(dispex, _bstr_("0"), 0, &did);
EXPECT_HR(hr, S_OK);
ok(did == DISPID_DOM_COLLECTION_BASE, "got %d\n", did);
len = 0;
hr = IXMLDOMSelection_get_length(selection, &len);
EXPECT_HR(hr, S_OK);
ok(len == 1, "got %d\n", len);
hr = IDispatchEx_GetDispID(dispex, _bstr_("10"), 0, &did);
EXPECT_HR(hr, S_OK);
ok(did == DISPID_DOM_COLLECTION_BASE+10, "got %d\n", did);
IDispatchEx_Release(dispex);
/* IEnumVARIANT tests */
enum1 = NULL;
hr = IXMLDOMSelection_QueryInterface(selection, &IID_IEnumVARIANT, (void**)&enum1);
......
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