Commit 791dd955 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Moved IDispatchEx initialization to HTMLElement_Init.

parent 30d20475
......@@ -1297,12 +1297,14 @@ static dispex_static_data_t HTMLElement_dispex = {
void HTMLElement_Init(HTMLElement *This)
{
This->node.vtbl = &HTMLElementImplVtbl;
This->lpHTMLElementVtbl = &HTMLElementVtbl;
ConnectionPointContainer_Init(&This->cp_container, (IUnknown*)HTMLELEM(This));
HTMLElement2_Init(This);
if(!This->node.dispex.data)
init_dispex(&This->node.dispex, (IUnknown*)HTMLELEM(This), &HTMLElement_dispex);
}
HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode)
......@@ -1351,15 +1353,13 @@ HTMLElement *HTMLElement_Create(nsIDOMNode *nsnode)
if(!ret) {
ret = heap_alloc_zero(sizeof(HTMLElement));
HTMLElement_Init(ret);
}
ret->node.vtbl = &HTMLElementImplVtbl;
}
nsAString_Finish(&class_name_str);
ret->nselem = nselem;
if(!ret->node.dispex.data)
init_dispex(&ret->node.dispex, (IUnknown*)HTMLELEM(ret), &HTMLElement_dispex);
return ret;
}
......
......@@ -1078,12 +1078,11 @@ HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
HTMLInputElement *ret = heap_alloc_zero(sizeof(HTMLInputElement));
nsresult nsres;
HTMLElement_Init(&ret->element);
ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
ret->element.node.vtbl = &HTMLInputElementImplVtbl;
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLINPUT(ret), &HTMLInputElement_dispex);
HTMLElement_Init(&ret->element);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
(void**)&ret->nsinput);
......
......@@ -350,17 +350,16 @@ HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
HTMLOptionElement *ret = heap_alloc_zero(sizeof(HTMLOptionElement));
nsresult nsres;
HTMLElement_Init(&ret->element);
ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl;
ret->element.node.vtbl = &HTMLOptionElementImplVtbl;
HTMLElement_Init(&ret->element);
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLOPTION(ret), &HTMLOptionElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLOptionElement interface: %08x\n", nsres);
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLOPTION(ret), &HTMLOptionElement_dispex);
return &ret->element;
}
......
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