Commit a70bbf82 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Moved init_dispex call to HTMLElement_Init.

parent 356d60df
...@@ -478,7 +478,7 @@ HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem) ...@@ -478,7 +478,7 @@ HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
{ {
HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement)); HTMLAnchorElement *ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
HTMLElement_Init(&ret->element); HTMLElement_Init(&ret->element, NULL);
ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl; ret->lpHTMLAnchorElementVtbl = &HTMLAnchorElementVtbl;
ret->element.node.vtbl = &HTMLAnchorElementImplVtbl; ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
......
...@@ -766,13 +766,11 @@ HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem) ...@@ -766,13 +766,11 @@ HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
TRACE("(%p)->(%p)\n", ret, nselem); TRACE("(%p)->(%p)\n", ret, nselem);
HTMLTextContainer_Init(&ret->textcont);
ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl; ret->lpHTMLBodyElementVtbl = &HTMLBodyElementVtbl;
init_dispex(&ret->textcont.element.node.dispex, (IUnknown*)HTMLBODY(ret), &HTMLBodyElement_dispex);
ret->textcont.element.node.vtbl = &HTMLBodyElementImplVtbl; ret->textcont.element.node.vtbl = &HTMLBodyElementImplVtbl;
HTMLTextContainer_Init(&ret->textcont, &HTMLBodyElement_dispex);
ConnectionPoint_Init(&ret->cp_propnotif, &ret->textcont.element.cp_container, &IID_IPropertyNotifySink); ConnectionPoint_Init(&ret->cp_propnotif, &ret->textcont.element.cp_container, &IID_IPropertyNotifySink);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement, nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLBodyElement,
......
...@@ -193,8 +193,7 @@ HTMLElement *HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode ...@@ -193,8 +193,7 @@ HTMLElement *HTMLCommentElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode
ret->element.node.vtbl = &HTMLCommentElementImplVtbl; ret->element.node.vtbl = &HTMLCommentElementImplVtbl;
ret->lpIHTMLCommentElementVtbl = &HTMLCommentElementVtbl; ret->lpIHTMLCommentElementVtbl = &HTMLCommentElementVtbl;
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLCOMMENT(ret), &HTMLCommentElement_dispex); HTMLElement_Init(&ret->element, &HTMLCommentElement_dispex);
HTMLElement_Init(&ret->element);
HTMLDOMNode_Init(doc, &ret->element.node, nsnode); HTMLDOMNode_Init(doc, &ret->element.node, nsnode);
return &ret->element; return &ret->element;
......
...@@ -1458,7 +1458,7 @@ static dispex_static_data_t HTMLElement_dispex = { ...@@ -1458,7 +1458,7 @@ static dispex_static_data_t HTMLElement_dispex = {
HTMLElement_iface_tids HTMLElement_iface_tids
}; };
void HTMLElement_Init(HTMLElement *This) void HTMLElement_Init(HTMLElement *This, dispex_static_data_t *dispex_data)
{ {
This->lpHTMLElementVtbl = &HTMLElementVtbl; This->lpHTMLElementVtbl = &HTMLElementVtbl;
...@@ -1467,8 +1467,7 @@ void HTMLElement_Init(HTMLElement *This) ...@@ -1467,8 +1467,7 @@ void HTMLElement_Init(HTMLElement *This)
HTMLElement2_Init(This); HTMLElement2_Init(This);
HTMLElement3_Init(This); HTMLElement3_Init(This);
if(!This->node.dispex.data) init_dispex(&This->node.dispex, (IUnknown*)HTMLELEM(This), dispex_data ? dispex_data : &HTMLElement_dispex);
init_dispex(&This->node.dispex, (IUnknown*)HTMLELEM(This), &HTMLElement_dispex);
} }
HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_generic) HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL use_generic)
...@@ -1527,7 +1526,7 @@ HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL ...@@ -1527,7 +1526,7 @@ HTMLElement *HTMLElement_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, BOOL
if(!ret) { if(!ret) {
ret = heap_alloc_zero(sizeof(HTMLElement)); ret = heap_alloc_zero(sizeof(HTMLElement));
HTMLElement_Init(ret); HTMLElement_Init(ret, NULL);
ret->node.vtbl = &HTMLElementImplVtbl; ret->node.vtbl = &HTMLElementImplVtbl;
} }
......
...@@ -178,8 +178,7 @@ HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement *nselem) ...@@ -178,8 +178,7 @@ HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLGenericElementVtbl = &HTMLGenericElementVtbl; ret->lpHTMLGenericElementVtbl = &HTMLGenericElementVtbl;
ret->element.node.vtbl = &HTMLGenericElementImplVtbl; ret->element.node.vtbl = &HTMLGenericElementImplVtbl;
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLGENERIC(ret), &HTMLGenericElement_dispex); HTMLElement_Init(&ret->element, &HTMLGenericElement_dispex);
HTMLElement_Init(&ret->element);
return &ret->element; return &ret->element;
} }
...@@ -288,8 +288,7 @@ HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement *nselem) ...@@ -288,8 +288,7 @@ HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement *nselem)
ret->lpIHTMLFrameBase2Vtbl = &HTMLIFrameBase2Vtbl; ret->lpIHTMLFrameBase2Vtbl = &HTMLIFrameBase2Vtbl;
ret->element.node.vtbl = &HTMLIFrameImplVtbl; ret->element.node.vtbl = &HTMLIFrameImplVtbl;
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLFRAMEBASE2(ret), &HTMLIFrame_dispex); HTMLElement_Init(&ret->element, &HTMLIFrame_dispex);
HTMLElement_Init(&ret->element);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLIFrameElement, (void**)&ret->nsiframe); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLIFrameElement, (void**)&ret->nsiframe);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
......
...@@ -607,8 +607,7 @@ HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement *nselem) ...@@ -607,8 +607,7 @@ HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement *nselem)
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLImageElement: %08x\n", nsres); ERR("Could not get nsIDOMHTMLImageElement: %08x\n", nsres);
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLIMG(ret), &HTMLImgElement_dispex); HTMLElement_Init(&ret->element, &HTMLImgElement_dispex);
HTMLElement_Init(&ret->element);
return &ret->element; return &ret->element;
} }
...@@ -1176,8 +1176,7 @@ HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem) ...@@ -1176,8 +1176,7 @@ HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl; ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
ret->element.node.vtbl = &HTMLInputElementImplVtbl; ret->element.node.vtbl = &HTMLInputElementImplVtbl;
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLINPUT(ret), &HTMLInputElement_dispex); HTMLElement_Init(&ret->element, &HTMLInputElement_dispex);
HTMLElement_Init(&ret->element);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement, nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLInputElement,
(void**)&ret->nsinput); (void**)&ret->nsinput);
......
...@@ -347,8 +347,7 @@ HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem) ...@@ -347,8 +347,7 @@ HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl; ret->lpHTMLOptionElementVtbl = &HTMLOptionElementVtbl;
ret->element.node.vtbl = &HTMLOptionElementImplVtbl; ret->element.node.vtbl = &HTMLOptionElementImplVtbl;
HTMLElement_Init(&ret->element); HTMLElement_Init(&ret->element, &HTMLOptionElement_dispex);
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLOPTION(ret), &HTMLOptionElement_dispex);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLOptionElement, (void**)&ret->nsoption);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
......
...@@ -311,11 +311,11 @@ HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement *nselem) ...@@ -311,11 +311,11 @@ HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement *nselem)
HTMLScriptElement *ret = heap_alloc_zero(sizeof(HTMLScriptElement)); HTMLScriptElement *ret = heap_alloc_zero(sizeof(HTMLScriptElement));
nsresult nsres; nsresult nsres;
HTMLElement_Init(&ret->element);
ret->lpHTMLScriptElementVtbl = &HTMLScriptElementVtbl; ret->lpHTMLScriptElementVtbl = &HTMLScriptElementVtbl;
ret->element.node.vtbl = &HTMLScriptElementImplVtbl; ret->element.node.vtbl = &HTMLScriptElementImplVtbl;
HTMLElement_Init(&ret->element, NULL);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
ERR("Could not get nsIDOMHTMLScriptElement: %08x\n", nsres); ERR("Could not get nsIDOMHTMLScriptElement: %08x\n", nsres);
......
...@@ -510,8 +510,7 @@ HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem) ...@@ -510,8 +510,7 @@ HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl; ret->lpHTMLSelectElementVtbl = &HTMLSelectElementVtbl;
ret->element.node.vtbl = &HTMLSelectElementImplVtbl; ret->element.node.vtbl = &HTMLSelectElementImplVtbl;
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLSELECT(ret), &HTMLSelectElement_dispex); HTMLElement_Init(&ret->element, &HTMLSelectElement_dispex);
HTMLElement_Init(&ret->element);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLSelectElement, nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLSelectElement,
(void**)&ret->nsselect); (void**)&ret->nsselect);
......
...@@ -582,8 +582,7 @@ HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem) ...@@ -582,8 +582,7 @@ HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem)
ret->element.node.vtbl = &HTMLTableImplVtbl; ret->element.node.vtbl = &HTMLTableImplVtbl;
ret->lpHTMLTableVtbl = &HTMLTableVtbl; ret->lpHTMLTableVtbl = &HTMLTableVtbl;
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLTABLE(ret), &HTMLTable_dispex); HTMLElement_Init(&ret->element, &HTMLTable_dispex);
HTMLElement_Init(&ret->element);
ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents); ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents);
......
...@@ -325,8 +325,7 @@ HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement *nselem) ...@@ -325,8 +325,7 @@ HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement *nselem)
ret->lpHTMLTableRowVtbl = &HTMLTableRowVtbl; ret->lpHTMLTableRowVtbl = &HTMLTableRowVtbl;
ret->element.node.vtbl = &HTMLTableRowImplVtbl; ret->element.node.vtbl = &HTMLTableRowImplVtbl;
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLTABLEROW(ret), &HTMLTableRow_dispex); HTMLElement_Init(&ret->element, &HTMLTableRow_dispex);
HTMLElement_Init(&ret->element);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
......
...@@ -415,11 +415,11 @@ HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem) ...@@ -415,11 +415,11 @@ HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
HTMLTextAreaElement *ret = heap_alloc_zero(sizeof(HTMLTextAreaElement)); HTMLTextAreaElement *ret = heap_alloc_zero(sizeof(HTMLTextAreaElement));
nsresult nsres; nsresult nsres;
HTMLElement_Init(&ret->element);
ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl; ret->lpHTMLTextAreaElementVtbl = &HTMLTextAreaElementVtbl;
ret->element.node.vtbl = &HTMLTextAreaElementImplVtbl; ret->element.node.vtbl = &HTMLTextAreaElementImplVtbl;
HTMLElement_Init(&ret->element, NULL);
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement, nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTextAreaElement,
(void**)&ret->nstextarea); (void**)&ret->nstextarea);
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
......
...@@ -182,11 +182,11 @@ static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = { ...@@ -182,11 +182,11 @@ static const IHTMLTextContainerVtbl HTMLTextContainerVtbl = {
HTMLTextContainer_get_onscroll HTMLTextContainer_get_onscroll
}; };
void HTMLTextContainer_Init(HTMLTextContainer *This) void HTMLTextContainer_Init(HTMLTextContainer *This, dispex_static_data_t *dispex_data)
{ {
HTMLElement_Init(&This->element);
This->lpHTMLTextContainerVtbl = &HTMLTextContainerVtbl; This->lpHTMLTextContainerVtbl = &HTMLTextContainerVtbl;
HTMLElement_Init(&This->element, dispex_data);
ConnectionPoint_Init(&This->cp, &This->element.cp_container, &DIID_HTMLTextContainerEvents); ConnectionPoint_Init(&This->cp, &This->element.cp_container, &DIID_HTMLTextContainerEvents);
} }
...@@ -669,10 +669,10 @@ HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement*); ...@@ -669,10 +669,10 @@ HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement*);
HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement*); HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement*);
void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*); void HTMLDOMNode_Init(HTMLDocumentNode*,HTMLDOMNode*,nsIDOMNode*);
void HTMLElement_Init(HTMLElement*); void HTMLElement_Init(HTMLElement*,dispex_static_data_t*);
void HTMLElement2_Init(HTMLElement*); void HTMLElement2_Init(HTMLElement*);
void HTMLElement3_Init(HTMLElement*); void HTMLElement3_Init(HTMLElement*);
void HTMLTextContainer_Init(HTMLTextContainer*); void HTMLTextContainer_Init(HTMLTextContainer*,dispex_static_data_t*);
HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**); HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**);
void HTMLDOMNode_destructor(HTMLDOMNode*); void HTMLDOMNode_destructor(HTMLDOMNode*);
......
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