mshtml: Pass HTMLDOMNode pointer to HTMLElement's destructor.

oldstable
Jacek Caban 2007-10-04 02:08:56 +02:00 committed by Alexandre Julliard
parent 6270a46ded
commit e04cdbb82c
7 changed files with 64 additions and 40 deletions

View File

@ -412,12 +412,6 @@ static HRESULT WINAPI HTMLAnchorElement_blur(IHTMLAnchorElement *iface)
return E_NOTIMPL;
}
static void HTMLAnchorElement_destructor(IUnknown *iface)
{
HTMLAnchorElement *This = HTMLANCHOR_THIS(iface);
mshtml_free(This);
}
static const IHTMLAnchorElementVtbl HTMLAnchorElementVtbl = {
HTMLAnchorElement_QueryInterface,
HTMLAnchorElement_AddRef,
@ -469,6 +463,16 @@ static const IHTMLAnchorElementVtbl HTMLAnchorElementVtbl = {
HTMLAnchorElement_blur
};
#define HTMLANCHOR_NODE_THIS(iface) DEFINE_THIS2(HTMLAnchorElement, element.node, iface)
static void HTMLAnchorElement_destructor(HTMLDOMNode *iface)
{
HTMLAnchorElement *This = HTMLANCHOR_NODE_THIS(iface);
mshtml_free(This);
}
#undef HTMLANCHOR_NODE_THIS
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement *nselem)
{
HTMLAnchorElement *ret = mshtml_alloc(sizeof(HTMLAnchorElement));

View File

@ -426,14 +426,7 @@ static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, I
return S_OK;
}
static void HTMLBodyElement_destructor(IUnknown *iface)
{
HTMLBodyElement *This = HTMLBODY_THIS(iface);
ConnectionPointContainer_Destroy(&This->cp_container);
nsIDOMHTMLBodyElement_Release(This->nsbody);
mshtml_free(This);
}
#undef HTMLBODY_THIS
static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = {
HTMLBodyElement_QueryInterface,
@ -480,6 +473,19 @@ static const IHTMLBodyElementVtbl HTMLBodyElementVtbl = {
HTMLBodyElement_createTextRange
};
#define HTMLBODY_NODE_THIS(iface) DEFINE_THIS2(HTMLBodyElement, textcont.element.node, iface)
static void HTMLBodyElement_destructor(HTMLDOMNode *iface)
{
HTMLBodyElement *This = HTMLBODY_NODE_THIS(iface);
ConnectionPointContainer_Destroy(&This->cp_container);
nsIDOMHTMLBodyElement_Release(This->nsbody);
mshtml_free(This);
}
#undef HTMLBODY_NODE_THIS
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement *nselem)
{
HTMLBodyElement *ret = mshtml_alloc(sizeof(HTMLBodyElement));

View File

@ -1270,7 +1270,7 @@ static void HTMLElement_destructor(HTMLDOMNode *iface)
HTMLElement *This = HTMLELEM_NODE_THIS(iface);
if(This->destructor)
This->destructor(This->impl);
This->destructor(&This->node);
if(This->nselem)
nsIDOMHTMLElement_Release(This->nselem);

View File

@ -649,14 +649,6 @@ static HRESULT WINAPI HTMLInputElement_get_start(IHTMLInputElement *iface, BSTR
return E_NOTIMPL;
}
static void HTMLInputElement_destructor(IUnknown *iface)
{
HTMLInputElement *This = HTMLINPUT_THIS(iface);
nsIDOMHTMLInputElement_Release(This->nsinput);
mshtml_free(This);
}
#undef HTMLINPUT_THIS
static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
@ -734,6 +726,18 @@ static const IHTMLInputElementVtbl HTMLInputElementVtbl = {
HTMLInputElement_get_start
};
#define HTMLINPUT_NODE_THIS(iface) DEFINE_THIS2(HTMLInputElement, element.node, iface)
static void HTMLInputElement_destructor(HTMLDOMNode *iface)
{
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
nsIDOMHTMLInputElement_Release(This->nsinput);
mshtml_free(This);
}
#undef HTMLINPUT_NODE_THIS
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
{
HTMLInputElement *ret = mshtml_alloc(sizeof(HTMLInputElement));

View File

@ -43,7 +43,7 @@ typedef struct {
nsIDOMHTMLSelectElement *nsselect;
} HTMLSelectElement;
#define HTMLSELECT(x) ((IHTMLSelectElement*) &(x)->lpHTMLSelectElementVtbl)
#define HTMLSELECT(x) ((IHTMLSelectElement*) &(x)->lpHTMLSelectElementVtbl)
#define HTMLSELECT_THIS(iface) DEFINE_THIS(HTMLSelectElement, HTMLSelectElement, iface)
@ -341,13 +341,7 @@ static HRESULT WINAPI HTMLSelectElement_tags(IHTMLSelectElement *iface, VARIANT
return E_NOTIMPL;
}
static void HTMLSelectElement_destructor(IUnknown *iface)
{
HTMLSelectElement *This = HTMLSELECT_THIS(iface);
nsIDOMHTMLSelectElement_Release(This->nsselect);
mshtml_free(This);
}
#undef HTMLSELECT_THIS
static const IHTMLSelectElementVtbl HTMLSelectElementVtbl = {
HTMLSelectElement_QueryInterface,
@ -383,6 +377,18 @@ static const IHTMLSelectElementVtbl HTMLSelectElementVtbl = {
HTMLSelectElement_tags
};
#define HTMLSELECT_NODE_THIS(iface) DEFINE_THIS2(HTMLSelectElement, element.node, iface)
static void HTMLSelectElement_destructor(HTMLDOMNode *iface)
{
HTMLSelectElement *This = HTMLSELECT_NODE_THIS(iface);
nsIDOMHTMLSelectElement_Release(This->nsselect);
mshtml_free(This);
}
#undef HTMLSELECT_NODE_THIS
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement *nselem)
{
HTMLSelectElement *ret = mshtml_alloc(sizeof(HTMLSelectElement));

View File

@ -346,14 +346,6 @@ static HRESULT WINAPI HTMLTextAreaElement_createTextRange(IHTMLTextAreaElement *
return E_NOTIMPL;
}
static void HTMLTextAreaElement_destructor(IUnknown *iface)
{
HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
nsIDOMHTMLTextAreaElement_Release(This->nstextarea);
mshtml_free(This);
}
#undef HTMLTXTAREA_THIS
static const IHTMLTextAreaElementVtbl HTMLTextAreaElementVtbl = {
@ -392,6 +384,18 @@ static const IHTMLTextAreaElementVtbl HTMLTextAreaElementVtbl = {
HTMLTextAreaElement_createTextRange
};
#define HTMLTXTAREA_NODE_THIS(iface) DEFINE_THIS2(HTMLTextAreaElement, element.node, iface)
static void HTMLTextAreaElement_destructor(HTMLDOMNode *iface)
{
HTMLTextAreaElement *This = HTMLTXTAREA_NODE_THIS(iface);
nsIDOMHTMLTextAreaElement_Release(This->nstextarea);
mshtml_free(This);
}
#undef HTMLTXTAREA_NODE_THIS
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
{
HTMLTextAreaElement *ret = mshtml_alloc(sizeof(HTMLTextAreaElement));

View File

@ -272,7 +272,7 @@ typedef struct {
const IHTMLElementVtbl *lpHTMLElementVtbl;
const IHTMLElement2Vtbl *lpHTMLElement2Vtbl;
void (*destructor)(IUnknown*);
void (*destructor)(HTMLDOMNode*);
nsIDOMHTMLElement *nselem;