mshtml: Make connection points container independent.
This commit is contained in:
parent
f09a6f7283
commit
88f4fb1f4f
|
@ -75,13 +75,13 @@ static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface,
|
|||
static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
|
||||
{
|
||||
ConnectionPoint *This = CONPOINT_THIS(iface);
|
||||
return IHTMLDocument2_AddRef(HTMLDOC(This->doc));
|
||||
return IConnectionPointContainer_AddRef(This->container);
|
||||
}
|
||||
|
||||
static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
|
||||
{
|
||||
ConnectionPoint *This = CONPOINT_THIS(iface);
|
||||
return IHTMLDocument2_Release(HTMLDOC(This->doc));
|
||||
return IConnectionPointContainer_Release(This->container);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID)
|
||||
|
@ -107,7 +107,7 @@ static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoi
|
|||
if(!ppCPC)
|
||||
return E_POINTER;
|
||||
|
||||
*ppCPC = CONPTCONT(&This->doc->cp_container);
|
||||
*ppCPC = This->container;
|
||||
IConnectionPointContainer_AddRef(*ppCPC);
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -184,10 +184,11 @@ static const IConnectionPointVtbl ConnectionPointVtbl =
|
|||
ConnectionPoint_EnumConnections
|
||||
};
|
||||
|
||||
void ConnectionPoint_Init(ConnectionPoint *cp, HTMLDocument *doc, REFIID riid, ConnectionPoint *prev)
|
||||
void ConnectionPoint_Init(ConnectionPoint *cp, IConnectionPointContainer *container,
|
||||
REFIID riid, ConnectionPoint *prev)
|
||||
{
|
||||
cp->lpConnectionPointVtbl = &ConnectionPointVtbl;
|
||||
cp->doc = doc;
|
||||
cp->container = container;
|
||||
cp->sinks = NULL;
|
||||
cp->sinks_size = 0;
|
||||
cp->iid = *riid;
|
||||
|
|
|
@ -1142,10 +1142,12 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
|
|||
HTMLDocument_Service_Init(ret);
|
||||
HTMLDocument_Hlink_Init(ret);
|
||||
|
||||
ConnectionPoint_Init(&ret->cp_propnotif, ret, &IID_IPropertyNotifySink, NULL);
|
||||
ConnectionPoint_Init(&ret->cp_htmldocevents, ret, &DIID_HTMLDocumentEvents, &ret->cp_propnotif);
|
||||
ConnectionPoint_Init(&ret->cp_htmldocevents2, ret, &DIID_HTMLDocumentEvents2,
|
||||
&ret->cp_htmldocevents);
|
||||
ConnectionPoint_Init(&ret->cp_propnotif, CONPTCONT(&ret->cp_container),
|
||||
&IID_IPropertyNotifySink, NULL);
|
||||
ConnectionPoint_Init(&ret->cp_htmldocevents, CONPTCONT(&ret->cp_container),
|
||||
&DIID_HTMLDocumentEvents, &ret->cp_propnotif);
|
||||
ConnectionPoint_Init(&ret->cp_htmldocevents2, CONPTCONT(&ret->cp_container),
|
||||
&DIID_HTMLDocumentEvents2, &ret->cp_htmldocevents);
|
||||
ConnectionPointContainer_Init(&ret->cp_container, &ret->cp_propnotif, (IUnknown*)HTMLDOC(ret));
|
||||
|
||||
ret->nscontainer = NSContainer_Create(ret, NULL);
|
||||
|
|
|
@ -81,7 +81,7 @@ typedef struct {
|
|||
struct ConnectionPoint {
|
||||
const IConnectionPointVtbl *lpConnectionPointVtbl;
|
||||
|
||||
HTMLDocument *doc;
|
||||
IConnectionPointContainer *container;
|
||||
|
||||
union {
|
||||
IUnknown *unk;
|
||||
|
@ -346,7 +346,7 @@ void HTMLDocument_Window_Init(HTMLDocument*);
|
|||
void HTMLDocument_Service_Init(HTMLDocument*);
|
||||
void HTMLDocument_Hlink_Init(HTMLDocument*);
|
||||
|
||||
void ConnectionPoint_Init(ConnectionPoint*,HTMLDocument*,REFIID,ConnectionPoint*);
|
||||
void ConnectionPoint_Init(ConnectionPoint*,IConnectionPointContainer*,REFIID,ConnectionPoint*);
|
||||
void ConnectionPointContainer_Init(ConnectionPointContainer*,ConnectionPoint*,IUnknown*);
|
||||
void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
|
||||
|
||||
|
|
Loading…
Reference in New Issue