Commit 00324ea8 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: Use an iface instead of a vtbl pointer in HTMLTableRow.

parent ca129550
...@@ -34,47 +34,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); ...@@ -34,47 +34,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
typedef struct { typedef struct {
HTMLElement element; HTMLElement element;
const IHTMLTableRowVtbl *lpHTMLTableRowVtbl; IHTMLTableRow IHTMLTableRow_iface;
nsIDOMHTMLTableRowElement *nsrow; nsIDOMHTMLTableRowElement *nsrow;
} HTMLTableRow; } HTMLTableRow;
#define HTMLTABLEROW(x) (&(x)->lpHTMLTableRowVtbl) static inline HTMLTableRow *impl_from_IHTMLTableRow(IHTMLTableRow *iface)
{
#define HTMLTABLEROW_THIS(iface) DEFINE_THIS(HTMLTableRow, HTMLTableRow, iface) return CONTAINING_RECORD(iface, HTMLTableRow, IHTMLTableRow_iface);
}
static HRESULT WINAPI HTMLTableRow_QueryInterface(IHTMLTableRow *iface, static HRESULT WINAPI HTMLTableRow_QueryInterface(IHTMLTableRow *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv); return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
} }
static ULONG WINAPI HTMLTableRow_AddRef(IHTMLTableRow *iface) static ULONG WINAPI HTMLTableRow_AddRef(IHTMLTableRow *iface)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node)); return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
} }
static ULONG WINAPI HTMLTableRow_Release(IHTMLTableRow *iface) static ULONG WINAPI HTMLTableRow_Release(IHTMLTableRow *iface)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node)); return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
} }
static HRESULT WINAPI HTMLTableRow_GetTypeInfoCount(IHTMLTableRow *iface, UINT *pctinfo) static HRESULT WINAPI HTMLTableRow_GetTypeInfoCount(IHTMLTableRow *iface, UINT *pctinfo)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo); return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
} }
static HRESULT WINAPI HTMLTableRow_GetTypeInfo(IHTMLTableRow *iface, UINT iTInfo, static HRESULT WINAPI HTMLTableRow_GetTypeInfo(IHTMLTableRow *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo) LCID lcid, ITypeInfo **ppTInfo)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo); return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
} }
...@@ -82,7 +83,7 @@ static HRESULT WINAPI HTMLTableRow_GetIDsOfNames(IHTMLTableRow *iface, REFIID ri ...@@ -82,7 +83,7 @@ static HRESULT WINAPI HTMLTableRow_GetIDsOfNames(IHTMLTableRow *iface, REFIID ri
LPOLESTR *rgszNames, UINT cNames, LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId) LCID lcid, DISPID *rgDispId)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId); return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
} }
...@@ -90,112 +91,112 @@ static HRESULT WINAPI HTMLTableRow_Invoke(IHTMLTableRow *iface, DISPID dispIdMem ...@@ -90,112 +91,112 @@ static HRESULT WINAPI HTMLTableRow_Invoke(IHTMLTableRow *iface, DISPID dispIdMem
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams, return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
pVarResult, pExcepInfo, puArgErr); pVarResult, pExcepInfo, puArgErr);
} }
static HRESULT WINAPI HTMLTableRow_put_align(IHTMLTableRow *iface, BSTR v) static HRESULT WINAPI HTMLTableRow_put_align(IHTMLTableRow *iface, BSTR v)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v)); FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p) static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v) static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v)); FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_get_vAlign(IHTMLTableRow *iface, BSTR *p) static HRESULT WINAPI HTMLTableRow_get_vAlign(IHTMLTableRow *iface, BSTR *p)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_put_bgColor(IHTMLTableRow *iface, VARIANT v) static HRESULT WINAPI HTMLTableRow_put_bgColor(IHTMLTableRow *iface, VARIANT v)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_get_bgColor(IHTMLTableRow *iface, VARIANT *p) static HRESULT WINAPI HTMLTableRow_get_bgColor(IHTMLTableRow *iface, VARIANT *p)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_put_borderColor(IHTMLTableRow *iface, VARIANT v) static HRESULT WINAPI HTMLTableRow_put_borderColor(IHTMLTableRow *iface, VARIANT v)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_get_borderColor(IHTMLTableRow *iface, VARIANT *p) static HRESULT WINAPI HTMLTableRow_get_borderColor(IHTMLTableRow *iface, VARIANT *p)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_put_borderColorLight(IHTMLTableRow *iface, VARIANT v) static HRESULT WINAPI HTMLTableRow_put_borderColorLight(IHTMLTableRow *iface, VARIANT v)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_get_borderColorLight(IHTMLTableRow *iface, VARIANT *p) static HRESULT WINAPI HTMLTableRow_get_borderColorLight(IHTMLTableRow *iface, VARIANT *p)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_put_borderColorDark(IHTMLTableRow *iface, VARIANT v) static HRESULT WINAPI HTMLTableRow_put_borderColorDark(IHTMLTableRow *iface, VARIANT v)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_get_borderColorDark(IHTMLTableRow *iface, VARIANT *p) static HRESULT WINAPI HTMLTableRow_get_borderColorDark(IHTMLTableRow *iface, VARIANT *p)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_get_rowIndex(IHTMLTableRow *iface, LONG *p) static HRESULT WINAPI HTMLTableRow_get_rowIndex(IHTMLTableRow *iface, LONG *p)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_get_selectionRowIndex(IHTMLTableRow *iface, LONG *p) static HRESULT WINAPI HTMLTableRow_get_selectionRowIndex(IHTMLTableRow *iface, LONG *p)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementCollection **p) static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementCollection **p)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
nsIDOMHTMLCollection *nscol; nsIDOMHTMLCollection *nscol;
nsresult nsres; nsresult nsres;
...@@ -207,7 +208,7 @@ static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementC ...@@ -207,7 +208,7 @@ static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementC
return E_FAIL; return E_FAIL;
} }
*p = create_collection_from_htmlcol(This->element.node.doc, (IUnknown*)HTMLTABLEROW(This), nscol); *p = create_collection_from_htmlcol(This->element.node.doc, (IUnknown*)&This->IHTMLTableRow_iface, nscol);
nsIDOMHTMLCollection_Release(nscol); nsIDOMHTMLCollection_Release(nscol);
return S_OK; return S_OK;
...@@ -215,20 +216,18 @@ static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementC ...@@ -215,20 +216,18 @@ static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementC
static HRESULT WINAPI HTMLTableRow_insertCell(IHTMLTableRow *iface, LONG index, IDispatch **row) static HRESULT WINAPI HTMLTableRow_insertCell(IHTMLTableRow *iface, LONG index, IDispatch **row)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%d %p)\n", This, index, row); FIXME("(%p)->(%d %p)\n", This, index, row);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLTableRow_deleteCell(IHTMLTableRow *iface, LONG index) static HRESULT WINAPI HTMLTableRow_deleteCell(IHTMLTableRow *iface, LONG index)
{ {
HTMLTableRow *This = HTMLTABLEROW_THIS(iface); HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
FIXME("(%p)->(%d)\n", This, index); FIXME("(%p)->(%d)\n", This, index);
return E_NOTIMPL; return E_NOTIMPL;
} }
#undef HTMLTABLEROW_THIS
static const IHTMLTableRowVtbl HTMLTableRowVtbl = { static const IHTMLTableRowVtbl HTMLTableRowVtbl = {
HTMLTableRow_QueryInterface, HTMLTableRow_QueryInterface,
HTMLTableRow_AddRef, HTMLTableRow_AddRef,
...@@ -266,13 +265,13 @@ static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -266,13 +265,13 @@ static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
if(IsEqualGUID(&IID_IUnknown, riid)) { if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = HTMLTABLEROW(This); *ppv = &This->IHTMLTableRow_iface;
}else if(IsEqualGUID(&IID_IDispatch, riid)) { }else if(IsEqualGUID(&IID_IDispatch, riid)) {
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv); TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
*ppv = HTMLTABLEROW(This); *ppv = &This->IHTMLTableRow_iface;
}else if(IsEqualGUID(&IID_IHTMLTableRow, riid)) { }else if(IsEqualGUID(&IID_IHTMLTableRow, riid)) {
TRACE("(%p)->(IID_IHTMLTableRow %p)\n", This, ppv); TRACE("(%p)->(IID_IHTMLTableRow %p)\n", This, ppv);
*ppv = HTMLTABLEROW(This); *ppv = &This->IHTMLTableRow_iface;
} }
if(*ppv) { if(*ppv) {
...@@ -323,7 +322,7 @@ HRESULT HTMLTableRow_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HT ...@@ -323,7 +322,7 @@ HRESULT HTMLTableRow_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HT
if(!ret) if(!ret)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
ret->lpHTMLTableRowVtbl = &HTMLTableRowVtbl; ret->IHTMLTableRow_iface.lpVtbl = &HTMLTableRowVtbl;
ret->element.node.vtbl = &HTMLTableRowImplVtbl; ret->element.node.vtbl = &HTMLTableRowImplVtbl;
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
......
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