Commit c12b4b48 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Return event target as EventTarget from DispatchEx vtbl.

parent e1d54def
......@@ -5074,12 +5074,12 @@ static HRESULT HTMLElement_populate_props(DispatchEx *dispex)
return S_OK;
}
static event_target_t **HTMLElement_get_event_target_ptr(DispatchEx *dispex)
static EventTarget *HTMLElement_get_event_target(DispatchEx *dispex)
{
HTMLElement *This = impl_from_DispatchEx(dispex);
return This->node.vtbl->get_event_target
? &This->node.vtbl->get_event_target(&This->node)->ptr
: &This->node.event_target.ptr;
? This->node.vtbl->get_event_target(&This->node)
: &This->node.event_target;
}
static void HTMLElement_bind_event(DispatchEx *dispex, int eid)
......@@ -5113,7 +5113,7 @@ static dispex_static_data_vtbl_t HTMLElement_dispex_vtbl = {
HTMLElement_get_dispid,
HTMLElement_invoke,
HTMLElement_populate_props,
HTMLElement_get_event_target_ptr,
HTMLElement_get_event_target,
HTMLElement_bind_event
};
......
......@@ -902,15 +902,13 @@ HRESULT create_event_obj(IHTMLEventObj **ret)
static inline event_target_t *get_event_target_data(EventTarget *event_target, BOOL alloc)
{
const dispex_static_data_vtbl_t *vtbl = dispex_get_vtbl(&event_target->dispex);
event_target_t **ptr;
ptr = vtbl && vtbl->get_event_target_ptr
? vtbl->get_event_target_ptr(&event_target->dispex)
: &event_target->ptr;
if(*ptr || !alloc)
return *ptr;
if(vtbl && vtbl->get_event_target)
event_target = vtbl->get_event_target(&event_target->dispex);
if(event_target->ptr || !alloc)
return event_target->ptr;
return *ptr = heap_alloc_zero(sizeof(event_target_t));
return event_target->ptr = heap_alloc_zero(sizeof(event_target_t));
}
static HRESULT call_disp_func(IDispatch *disp, DISPPARAMS *dp, VARIANT *retv)
......
......@@ -2942,10 +2942,10 @@ static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD
return hres;
}
static event_target_t **HTMLWindow_get_event_target_ptr(DispatchEx *dispex)
static EventTarget *HTMLWindow_get_event_target(DispatchEx *dispex)
{
HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
return &This->event_target.ptr;
return &This->event_target;
}
static void HTMLWindow_bind_event(DispatchEx *dispex, int eid)
......@@ -2964,7 +2964,7 @@ static const dispex_static_data_vtbl_t HTMLWindow_dispex_vtbl = {
NULL,
HTMLWindow_invoke,
NULL,
HTMLWindow_get_event_target_ptr,
HTMLWindow_get_event_target,
HTMLWindow_bind_event
};
......
......@@ -259,7 +259,7 @@ typedef struct {
HRESULT (*invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
HRESULT (*populate_props)(DispatchEx*);
/* We abuse this vtbl for EventTarget functions to avoid separated vtbl. */
event_target_t **(*get_event_target_ptr)(DispatchEx*);
EventTarget *(*get_event_target)(DispatchEx*);
void (*bind_event)(DispatchEx*,int);
} dispex_static_data_vtbl_t;
......
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