Jacek Caban : mshtml: Share connection points between HTMLDocumentObj and its main HTMLDocumentNode .

Alexandre Julliard julliard at winehq.org
Tue Nov 24 12:40:21 CST 2009


Module: wine
Branch: master
Commit: 19415addecb470f652ee441d477b74130c65ef59
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=19415addecb470f652ee441d477b74130c65ef59

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Nov 23 19:28:17 2009 +0100

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 deletions(-)

diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c
index 10d8e29..293e303 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 5dfc4db..0e76a9c 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 ce13b48..17e01a2 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 {




More information about the wine-cvs mailing list