Commit d4248e95 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: COM cleanup for the IHTMLElement iface.

parent cd88a165
......@@ -106,7 +106,7 @@ static HRESULT WINAPI HTMLCommentElement_get_text(IHTMLCommentElement *iface, BS
TRACE("(%p)->(%p)\n", This, p);
return IHTMLElement_get_outerHTML(HTMLELEM(&This->element), p);
return IHTMLElement_get_outerHTML(&This->element.IHTMLElement_iface, p);
}
static HRESULT WINAPI HTMLCommentElement_put_atomic(IHTMLCommentElement *iface, LONG v)
......
......@@ -1005,8 +1005,8 @@ static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTa
if(FAILED(hres))
return hres;
*newElem = HTMLELEM(elem);
IHTMLElement_AddRef(HTMLELEM(elem));
*newElem = &elem->IHTMLElement_iface;
IHTMLElement_AddRef(&elem->IHTMLElement_iface);
return S_OK;
}
......
......@@ -284,19 +284,19 @@ static HRESULT WINAPI HTMLElement2_QueryInterface(IHTMLElement2 *iface,
REFIID riid, void **ppv)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
return IHTMLElement_QueryInterface(HTMLELEM(This), riid, ppv);
return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
}
static ULONG WINAPI HTMLElement2_AddRef(IHTMLElement2 *iface)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
return IHTMLElement_AddRef(HTMLELEM(This));
return IHTMLElement_AddRef(&This->IHTMLElement_iface);
}
static ULONG WINAPI HTMLElement2_Release(IHTMLElement2 *iface)
{
HTMLElement *This = HTMLELEM2_THIS(iface);
return IHTMLElement_Release(HTMLELEM(This));
return IHTMLElement_Release(&This->IHTMLElement_iface);
}
static HRESULT WINAPI HTMLElement2_GetTypeInfoCount(IHTMLElement2 *iface, UINT *pctinfo)
......@@ -739,7 +739,7 @@ static HRESULT WINAPI HTMLElement2_put_accessKey(IHTMLElement2 *iface, BSTR v)
V_VT(&var) = VT_BSTR;
V_BSTR(&var) = v;
return IHTMLElement_setAttribute(HTMLELEM(This), accessKeyW, var, 0);
return IHTMLElement_setAttribute(&This->IHTMLElement_iface, accessKeyW, var, 0);
}
static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
......@@ -1365,7 +1365,8 @@ static HRESULT WINAPI HTMLElement2_getElementsByTagName(IHTMLElement2 *iface, BS
return E_FAIL;
}
*pelColl = create_collection_from_nodelist(This->node.doc, (IUnknown*)HTMLELEM(This), nslist);
*pelColl = create_collection_from_nodelist(This->node.doc,
(IUnknown*)&This->IHTMLElement_iface, nslist);
nsIDOMNodeList_Release(nslist);
return S_OK;
}
......
......@@ -39,19 +39,19 @@ static HRESULT WINAPI HTMLElement3_QueryInterface(IHTMLElement3 *iface,
REFIID riid, void **ppv)
{
HTMLElement *This = HTMLELEM3_THIS(iface);
return IHTMLElement_QueryInterface(HTMLELEM(This), riid, ppv);
return IHTMLElement_QueryInterface(&This->IHTMLElement_iface, riid, ppv);
}
static ULONG WINAPI HTMLElement3_AddRef(IHTMLElement3 *iface)
{
HTMLElement *This = HTMLELEM3_THIS(iface);
return IHTMLElement_AddRef(HTMLELEM(This));
return IHTMLElement_AddRef(&This->IHTMLElement_iface);
}
static ULONG WINAPI HTMLElement3_Release(IHTMLElement3 *iface)
{
HTMLElement *This = HTMLELEM3_THIS(iface);
return IHTMLElement_Release(HTMLELEM(This));
return IHTMLElement_Release(&This->IHTMLElement_iface);
}
static HRESULT WINAPI HTMLElement3_GetTypeInfoCount(IHTMLElement3 *iface, UINT *pctinfo)
......
......@@ -215,7 +215,7 @@ static BOOL is_elem_id(HTMLElement *elem, LPCWSTR name)
BSTR elem_id;
HRESULT hres;
hres = IHTMLElement_get_id(HTMLELEM(elem), &elem_id);
hres = IHTMLElement_get_id(&elem->IHTMLElement_iface, &elem_id);
if(FAILED(hres)){
WARN("IHTMLElement_get_id failed: 0x%08x\n", hres);
return FALSE;
......@@ -308,7 +308,7 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
}
if(i != This->len) {
*pdisp = (IDispatch*)HTMLELEM(This->elems[i]);
*pdisp = (IDispatch*)&This->elems[i]->IHTMLElement_iface;
IDispatch_AddRef(*pdisp);
}
}else {
......@@ -326,7 +326,7 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
*pdisp = (IDispatch*)HTMLElementCollection_Create(This->ref_unk, buf.buf, buf.len);
}else {
if(buf.len == 1) {
*pdisp = (IDispatch*)HTMLELEM(buf.buf[0]);
*pdisp = (IDispatch*)&buf.buf[0]->IHTMLElement_iface;
IDispatch_AddRef(*pdisp);
}
......@@ -456,8 +456,8 @@ static HRESULT HTMLElementCollection_invoke(DispatchEx *dispex, DISPID id, LCID
switch(flags) {
case DISPATCH_PROPERTYGET:
V_VT(res) = VT_DISPATCH;
V_DISPATCH(res) = (IDispatch*)HTMLELEM(This->elems[idx]);
IHTMLElement_AddRef(HTMLELEM(This->elems[idx]));
V_DISPATCH(res) = (IDispatch*)&This->elems[idx]->IHTMLElement_iface;
IHTMLElement_AddRef(&This->elems[idx]->IHTMLElement_iface);
break;
default:
FIXME("unimplemented flags %x\n", flags);
......
......@@ -835,7 +835,8 @@ static HRESULT WINAPI HTMLImageElementFactory_create(IHTMLImageElementFactory *i
return hres;
}
hres = IHTMLElement_QueryInterface(HTMLELEM(elem), &IID_IHTMLImgElement, (void**)&img);
hres = IHTMLElement_QueryInterface(&elem->IHTMLElement_iface, &IID_IHTMLImgElement,
(void**)&img);
if(FAILED(hres)) {
ERR("IHTMLElement_QueryInterface failed: 0x%08x\n", hres);
return hres;
......
......@@ -40,19 +40,19 @@ static HRESULT WINAPI HTMLTextContainer_QueryInterface(IHTMLTextContainer *iface
REFIID riid, void **ppv)
{
HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
return IHTMLElement_QueryInterface(HTMLELEM(&This->element), riid, ppv);
return IHTMLElement_QueryInterface(&This->element.IHTMLElement_iface, riid, ppv);
}
static ULONG WINAPI HTMLTextContainer_AddRef(IHTMLTextContainer *iface)
{
HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
return IHTMLElement_AddRef(HTMLELEM(&This->element));
return IHTMLElement_AddRef(&This->element.IHTMLElement_iface);
}
static ULONG WINAPI HTMLTextContainer_Release(IHTMLTextContainer *iface)
{
HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
return IHTMLElement_Release(HTMLELEM(&This->element));
return IHTMLElement_Release(&This->element.IHTMLElement_iface);
}
static HRESULT WINAPI HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer *iface, UINT *pctinfo)
......
......@@ -394,7 +394,7 @@ static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex,
nsIDOMWindow_Release(nsWindow);
hres = IHTMLElement_get_id(HTMLELEM(&cur_window->frame_element->element), &id);
hres = IHTMLElement_get_id(&cur_window->frame_element->element.IHTMLElement_iface, &id);
if(FAILED(hres)) {
FIXME("IHTMLElement_get_id failed: 0x%08x\n", hres);
goto cleanup;
......
......@@ -549,7 +549,7 @@ typedef struct {
HTMLDOMNode node;
ConnectionPointContainer cp_container;
const IHTMLElementVtbl *lpHTMLElementVtbl;
IHTMLElement IHTMLElement_iface;
const IHTMLElement2Vtbl *lpHTMLElement2Vtbl;
const IHTMLElement3Vtbl *lpHTMLElement3Vtbl;
......@@ -642,7 +642,6 @@ struct HTMLDocumentNode {
#define STATUSCLB(x) ((IBindStatusCallback*) &(x)->lpBindStatusCallbackVtbl)
#define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
#define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
#define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
#define HTMLELEM3(x) ((IHTMLElement3*) &(x)->lpHTMLElement3Vtbl)
#define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
......
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