Commit 868a3e66 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: COM cleanup for the IHTMLDOMTextNode iface.

parent 031f595a
......@@ -34,47 +34,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
struct HTMLDOMTextNode {
HTMLDOMNode node;
const IHTMLDOMTextNodeVtbl *lpIHTMLDOMTextNodeVtbl;
IHTMLDOMTextNode IHTMLDOMTextNode_iface;
nsIDOMText *nstext;
};
#define HTMLTEXT(x) (&(x)->lpIHTMLDOMTextNodeVtbl)
#define HTMLTEXT_THIS(iface) DEFINE_THIS(HTMLDOMTextNode, IHTMLDOMTextNode, iface)
static inline HTMLDOMTextNode *impl_from_IHTMLDOMTextNode(IHTMLDOMTextNode *iface)
{
return CONTAINING_RECORD(iface, HTMLDOMTextNode, IHTMLDOMTextNode_iface);
}
static HRESULT WINAPI HTMLDOMTextNode_QueryInterface(IHTMLDOMTextNode *iface,
REFIID riid, void **ppv)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
return IHTMLDOMNode_QueryInterface(&This->node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI HTMLDOMTextNode_AddRef(IHTMLDOMTextNode *iface)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
return IHTMLDOMNode_AddRef(&This->node.IHTMLDOMNode_iface);
}
static ULONG WINAPI HTMLDOMTextNode_Release(IHTMLDOMTextNode *iface)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
return IHTMLDOMNode_Release(&This->node.IHTMLDOMNode_iface);
}
static HRESULT WINAPI HTMLDOMTextNode_GetTypeInfoCount(IHTMLDOMTextNode *iface, UINT *pctinfo)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
}
static HRESULT WINAPI HTMLDOMTextNode_GetTypeInfo(IHTMLDOMTextNode *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
}
......@@ -82,7 +83,7 @@ static HRESULT WINAPI HTMLDOMTextNode_GetIDsOfNames(IHTMLDOMTextNode *iface, REF
LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface, riid, rgszNames, cNames,
lcid, rgDispId);
}
......@@ -91,35 +92,35 @@ static HRESULT WINAPI HTMLDOMTextNode_Invoke(IHTMLDOMTextNode *iface, DISPID dis
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface, dispIdMember, riid, lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLDOMTextNode_put_data(IHTMLDOMTextNode *iface, BSTR v)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDOMTextNode_get_data(IHTMLDOMTextNode *iface, BSTR *p)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDOMTextNode_toString(IHTMLDOMTextNode *iface, BSTR *String)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
FIXME("(%p)->(%p)\n", This, String);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLDOMTextNode_get_length(IHTMLDOMTextNode *iface, LONG *p)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
PRUint32 length = 0;
nsresult nsres;
......@@ -135,13 +136,11 @@ static HRESULT WINAPI HTMLDOMTextNode_get_length(IHTMLDOMTextNode *iface, LONG *
static HRESULT WINAPI HTMLDOMTextNode_splitText(IHTMLDOMTextNode *iface, LONG offset, IHTMLDOMNode **pRetNode)
{
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
HTMLDOMTextNode *This = impl_from_IHTMLDOMTextNode(iface);
FIXME("(%p)->(%d %p)\n", This, offset, pRetNode);
return E_NOTIMPL;
}
#undef HTMLTEXT_THIS
static const IHTMLDOMTextNodeVtbl HTMLDOMTextNodeVtbl = {
HTMLDOMTextNode_QueryInterface,
HTMLDOMTextNode_AddRef,
......@@ -170,7 +169,7 @@ static HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
if(IsEqualGUID(&IID_IHTMLDOMTextNode, riid)) {
TRACE("(%p)->(IID_IHTMLDOMTextNode %p)\n", This, ppv);
*ppv = HTMLTEXT(This);
*ppv = &This->IHTMLDOMTextNode_iface;
}else {
return HTMLDOMNode_QI(&This->node, riid, ppv);
}
......@@ -231,7 +230,7 @@ HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLDO
return E_OUTOFMEMORY;
ret->node.vtbl = &HTMLDOMTextNodeImplVtbl;
ret->lpIHTMLDOMTextNodeVtbl = &HTMLDOMTextNodeVtbl;
ret->IHTMLDOMTextNode_iface.lpVtbl = &HTMLDOMTextNodeVtbl;
nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMText, (void**)&ret->nstext);
if(NS_FAILED(nsres)) {
......@@ -240,7 +239,8 @@ HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLDO
return E_FAIL;
}
init_dispex(&ret->node.dispex, (IUnknown*)HTMLTEXT(ret), &HTMLDOMTextNode_dispex);
init_dispex(&ret->node.dispex, (IUnknown*)&ret->IHTMLDOMTextNode_iface,
&HTMLDOMTextNode_dispex);
HTMLDOMNode_Init(doc, &ret->node, nsnode);
*node = &ret->node;
......
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