From f2fa7e662eeeea4482f6a58ee8f959cdb6621547 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 14 May 2015 13:25:34 +0200 Subject: [PATCH] mshtml: Pass EventTarget to get_event_handler. --- dlls/mshtml/htmlevent.c | 10 ++++++---- dlls/mshtml/htmlevent.h | 4 ++-- dlls/mshtml/htmlwindow.c | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index f962fc598a0..fe22b36a2b9 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1462,18 +1462,20 @@ HRESULT set_event_handler(EventTarget *event_target, HTMLDocumentNode *doc, even return S_OK; } -HRESULT get_event_handler(DispatchEx *dispex, event_target_t **event_target, eventid_t eid, VARIANT *var) +HRESULT get_event_handler(EventTarget *event_target, eventid_t eid, VARIANT *var) { + event_target_t *data; VARIANT *v; HRESULT hres; - hres = dispex_get_dprop_ref(dispex, event_info[eid].attr_name, FALSE, &v); + hres = dispex_get_dprop_ref(&event_target->dispex, event_info[eid].attr_name, FALSE, &v); if(SUCCEEDED(hres) && V_VT(v) != VT_EMPTY) return VariantCopy(var, v); - if(*event_target && (*event_target)->event_table[eid] && (*event_target)->event_table[eid]->handler_prop) { + data = get_event_target_data(event_target, FALSE); + if(data && data->event_table[eid] && data->event_table[eid]->handler_prop) { V_VT(var) = VT_DISPATCH; - V_DISPATCH(var) = (*event_target)->event_table[eid]->handler_prop; + V_DISPATCH(var) = data->event_table[eid]->handler_prop; IDispatch_AddRef(V_DISPATCH(var)); }else { V_VT(var) = VT_NULL; diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h index eeb8aabb861..1ca1cf7029c 100644 --- a/dlls/mshtml/htmlevent.h +++ b/dlls/mshtml/htmlevent.h @@ -55,7 +55,7 @@ void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN; void release_event_target(event_target_t*) DECLSPEC_HIDDEN; void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN; HRESULT set_event_handler(EventTarget*,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN; -HRESULT get_event_handler(DispatchEx*,event_target_t**,eventid_t,VARIANT*) DECLSPEC_HIDDEN; +HRESULT get_event_handler(EventTarget*,eventid_t,VARIANT*) DECLSPEC_HIDDEN; HRESULT attach_event(event_target_t**,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN; HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN; HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN; @@ -85,7 +85,7 @@ static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT * static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) { - return get_event_handler(&node->event_target.dispex, get_node_event_target(node), eid, var); + return get_event_handler(&node->event_target, eid, var); } static inline HRESULT set_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 7220c0cba0e..f31fb837131 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -105,7 +105,7 @@ static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIAN return E_FAIL; } - return get_event_handler(&window->inner_window->event_target.dispex, &window->inner_window->doc->body_event_target, eid, var); + return get_event_handler(&window->inner_window->event_target, eid, var); } static void detach_inner_window(HTMLInnerWindow *window)