From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmldoc.c | 86 ------------------------------------ dlls/mshtml/mshtml_private.h | 1 - dlls/mshtml/oleobj.c | 64 ++++++++++++++++++++------- 3 files changed, 48 insertions(+), 103 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 9666f7821af..9aa0cefc21d 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -4537,11 +4537,6 @@ static const ISupportErrorInfoVtbl SupportErrorInfoVtbl = { SupportErrorInfo_InterfaceSupportsErrorInfo };
-static inline HTMLDocumentNode *impl_from_IDispatchEx(IDispatchEx *iface) -{ - return CONTAINING_RECORD(iface, HTMLDocumentNode, IDispatchEx_iface); -} - static HRESULT has_elem_name(nsIDOMHTMLDocument *html_document, const WCHAR *name) { static const WCHAR fmt[] = L":-moz-any(applet,embed,form,iframe,img,object)[name="%s"]"; @@ -4642,84 +4637,6 @@ static HRESULT dispid_from_elem_name(HTMLDocumentNode *This, const WCHAR *name, return S_OK; }
-DISPEX_IDISPATCH_IMPL(DocDispatchEx, IDispatchEx, - impl_from_IDispatchEx(iface)->node.event_target.dispex) - -static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex, pid); -} - -static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, - VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_InvokeEx(&This->node.event_target.dispex.IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); -} - -static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_DeleteMemberByName(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex); -} - -static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_DeleteMemberByDispID(&This->node.event_target.dispex.IDispatchEx_iface, id); -} - -static HRESULT WINAPI DocDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetMemberProperties(&This->node.event_target.dispex.IDispatchEx_iface, id, grfdexFetch, pgrfdex); -} - -static HRESULT WINAPI DocDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetMemberName(&This->node.event_target.dispex.IDispatchEx_iface, id, pbstrName); -} - -static HRESULT WINAPI DocDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetNextDispID(&This->node.event_target.dispex.IDispatchEx_iface, grfdex, id, pid); -} - -static HRESULT WINAPI DocDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) -{ - HTMLDocumentNode *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetNameSpaceParent(&This->node.event_target.dispex.IDispatchEx_iface, ppunk); -} - -static const IDispatchExVtbl DocDispatchExVtbl = { - DocDispatchEx_QueryInterface, - DocDispatchEx_AddRef, - DocDispatchEx_Release, - DocDispatchEx_GetTypeInfoCount, - DocDispatchEx_GetTypeInfo, - DocDispatchEx_GetIDsOfNames, - DocDispatchEx_Invoke, - DocDispatchEx_GetDispID, - DocDispatchEx_InvokeEx, - DocDispatchEx_DeleteMemberByName, - DocDispatchEx_DeleteMemberByDispID, - DocDispatchEx_GetMemberProperties, - DocDispatchEx_GetMemberName, - DocDispatchEx_GetNextDispID, - DocDispatchEx_GetNameSpaceParent -}; - static inline HTMLDocumentNode *impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface) { return CONTAINING_RECORD(iface, HTMLDocumentNode, IProvideMultipleClassInfo_iface); @@ -5255,8 +5172,6 @@ static void *HTMLDocumentNode_query_interface(DispatchEx *dispex, REFIID riid) { HTMLDocumentNode *This = impl_from_DispatchEx(dispex);
- if(IsEqualGUID(&IID_IDispatch, riid) || IsEqualGUID(&IID_IDispatchEx, riid)) - return &This->IDispatchEx_iface; if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid)) return &This->IHTMLDocument2_iface; if(IsEqualGUID(&IID_IHTMLDocument3, riid)) @@ -5748,7 +5663,6 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo if(!doc) return NULL;
- doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl; doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e8e308a81f4..4b2cffd0f54 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -953,7 +953,6 @@ typedef struct nsDocumentEventListener nsDocumentEventListener; struct HTMLDocumentNode { HTMLDOMNode node;
- IDispatchEx IDispatchEx_iface; IHTMLDocument2 IHTMLDocument2_iface; IHTMLDocument3 IHTMLDocument3_iface; IHTMLDocument4 IHTMLDocument4_iface; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index 36ff99338e3..cd09117645d 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -3535,35 +3535,67 @@ static inline HTMLDocumentObj *impl_from_IDispatchEx(IDispatchEx *iface) }
HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(DispatchEx) -HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DispatchEx, GetTypeInfoCount, UINT*) -HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetTypeInfo, UINT,LCID,ITypeInfo**) -HTMLDOCUMENTOBJ_FWD_TO_NODE_5(DispatchEx, GetIDsOfNames, REFIID,LPOLESTR*,UINT,LCID,DISPID*) +DISPEX_IDISPATCH_NOUNK_IMPL(DocObjDispatchEx, IDispatchEx, + impl_from_IDispatchEx(iface)->doc_node->node.event_target.dispex)
-static HRESULT WINAPI DocObjDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, - WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI DocObjDispatchEx_GetDispID(IDispatchEx *iface, BSTR name, DWORD grfdex, DISPID *pid) { HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_InvokeEx(&This->doc_node->IDispatchEx_iface, dispIdMember, lcid, wFlags, pDispParams, - pVarResult, pExcepInfo, NULL); + return IDispatchEx_GetDispID(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, name, grfdex, pid); }
-HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetDispID, BSTR,DWORD,DISPID*) - static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
- return IDispatchEx_InvokeEx(&This->doc_node->IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + return IDispatchEx_InvokeEx(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id, lcid, + wFlags, pdp, pvarRes, pei, pspCaller); +} + +static HRESULT WINAPI DocObjDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_DeleteMemberByName(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex); +} + +static HRESULT WINAPI DocObjDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_DeleteMemberByDispID(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id); +} + +static HRESULT WINAPI DocObjDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetMemberProperties(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id, grfdexFetch, + pgrfdex); +} + +static HRESULT WINAPI DocObjDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *name) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetMemberName(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id, name); }
-HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DispatchEx, DeleteMemberByName, BSTR,DWORD) -HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DispatchEx, DeleteMemberByDispID, DISPID) -HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetMemberProperties, DISPID,DWORD,DWORD*) -HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DispatchEx, GetMemberName, DISPID,BSTR*) -HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetNextDispID, DWORD,DISPID,DISPID*) -HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DispatchEx, GetNameSpaceParent, IUnknown**) +static HRESULT WINAPI DocObjDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetNextDispID(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, grfdex, id, pid); +} + +static HRESULT WINAPI DocObjDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk) +{ + HTMLDocumentObj *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetNameSpaceParent(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, ppunk); +}
static const IDispatchExVtbl DocObjDispatchExVtbl = { DocObjDispatchEx_QueryInterface,