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

mshtml: Added a helper to get vtbl from DispatchEx and use it to access vtbl outside dispex.c.

parent fd2f645d
......@@ -1736,6 +1736,11 @@ void dispex_unlink(DispatchEx *This)
}
}
const dispex_static_data_vtbl_t *dispex_get_vtbl(DispatchEx *dispex)
{
return dispex->data->vtbl;
}
void release_dispex(DispatchEx *This)
{
dynamic_prop_t *prop;
......
......@@ -5093,7 +5093,7 @@ static void HTMLElement_bind_event(DispatchEx *dispex, int eid)
add_nsevent_listener(This->node.doc, This->node.nsnode, loadW);
return;
default:
This->node.doc->node.event_target.dispex.data->vtbl->bind_event(&This->node.doc->node.event_target.dispex, eid);
dispex_get_vtbl(&This->node.doc->node.event_target.dispex)->bind_event(&This->node.doc->node.event_target.dispex, eid);
}
}
......
......@@ -901,10 +901,11 @@ 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 = event_target->dispex.data->vtbl && event_target->dispex.data->vtbl->get_event_target_ptr
? event_target->dispex.data->vtbl->get_event_target_ptr(&event_target->dispex)
ptr = vtbl && vtbl->get_event_target_ptr
? vtbl->get_event_target_ptr(&event_target->dispex)
: &event_target->ptr;
if(*ptr || !alloc)
return *ptr;
......@@ -1394,8 +1395,9 @@ void detach_events(HTMLDocumentNode *doc)
/* Caller should ensure that it's called only once for given event in the target. */
static void bind_event(EventTarget *event_target, eventid_t eid)
{
if(event_target->dispex.data->vtbl->bind_event)
event_target->dispex.data->vtbl->bind_event(&event_target->dispex, eid);
const dispex_static_data_vtbl_t *vtbl = dispex_get_vtbl(&event_target->dispex);
if(vtbl->bind_event)
vtbl->bind_event(&event_target->dispex, eid);
else
FIXME("Unsupported event binding on target %p\n", event_target);
}
......
......@@ -2933,7 +2933,7 @@ static event_target_t **HTMLWindow_get_event_target_ptr(DispatchEx *dispex)
static void HTMLWindow_bind_event(DispatchEx *dispex, int eid)
{
HTMLInnerWindow *This = impl_from_DispatchEx(dispex);
This->doc->node.event_target.dispex.data->vtbl->bind_event(&This->doc->node.event_target.dispex, eid);
dispex_get_vtbl(&This->doc->node.event_target.dispex)->bind_event(&This->doc->node.event_target.dispex, eid);
}
static const dispex_static_data_vtbl_t HTMLWindow_dispex_vtbl = {
......
......@@ -303,6 +303,7 @@ void dispex_traverse(DispatchEx*,nsCycleCollectionTraversalCallback*) DECLSPEC_H
void dispex_unlink(DispatchEx*) DECLSPEC_HIDDEN;
void release_typelib(void) DECLSPEC_HIDDEN;
HRESULT get_htmldoc_classinfo(ITypeInfo **typeinfo) DECLSPEC_HIDDEN;
const dispex_static_data_vtbl_t *dispex_get_vtbl(DispatchEx*) DECLSPEC_HIDDEN;
typedef enum {
DISPEXPROP_CUSTOM,
......
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