From 19415addecb470f652ee441d477b74130c65ef59 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 23 Nov 2009 19:28:17 +0100 Subject: [PATCH] mshtml: Share connection points between HTMLDocumentObj and its main HTMLDocumentNode. --- dlls/mshtml/conpoint.c | 3 +++ dlls/mshtml/htmldoc.c | 2 ++ dlls/mshtml/mshtml_private.h | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c index 10d8e291bf4..293e303c293 100644 --- a/dlls/mshtml/conpoint.c +++ b/dlls/mshtml/conpoint.c @@ -260,6 +260,9 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo TRACE("(%p)->(%s %p)\n", This, debugstr_cp_guid(riid), ppCP); + if(This->forward_container) + return IConnectionPointContainer_FindConnectionPoint(CONPTCONT(This), riid, ppCP); + *ppCP = NULL; for(iter = This->cp_list; iter; iter = iter->next) { diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 5dfc4dbfb4b..0e76a9c8d9e 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1825,6 +1825,8 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob doc->ref = 1; doc->basedoc.window = window; + if(window == doc_obj->basedoc.window) + doc->basedoc.cp_container.forward_container = &doc_obj->basedoc.cp_container; nsIDOMHTMLDocument_AddRef(nsdoc); doc->nsdoc = nsdoc; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index ce13b487574..17e01a26601 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -261,11 +261,12 @@ typedef enum { EDITMODE } USERMODE; -typedef struct { +typedef struct ConnectionPointContainer { const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl; ConnectionPoint *cp_list; IUnknown *outer; + struct ConnectionPointContainer *forward_container; } ConnectionPointContainer; struct ConnectionPoint {