From 88f4fb1f4fe2e25399d21424974f73540fa5fb2a Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 29 Jun 2007 02:50:04 +0200 Subject: [PATCH] mshtml: Make connection points container independent. --- dlls/mshtml/conpoint.c | 11 ++++++----- dlls/mshtml/htmldoc.c | 10 ++++++---- dlls/mshtml/mshtml_private.h | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c index b19ca167e0f..b5c969c82cd 100644 --- a/dlls/mshtml/conpoint.c +++ b/dlls/mshtml/conpoint.c @@ -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; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index b5eee9a3cde..746c67af9fc 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -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); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index ecdab3db432..244a0e468d1 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -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*);