Module: wine Branch: master Commit: a46e0c617b84226fba0fc70fd4030b20f91d9940 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a46e0c617b84226fba0fc70fd4...
Author: Thomas Mullaly tmullaly@codeweavers.com Date: Sat Feb 26 23:55:16 2011 -0500
mshtml: Correctly forward IHTMLWindow's IHTMLDocument's ConnectionPointContainer.
---
dlls/mshtml/conpoint.c | 2 +- dlls/mshtml/htmlwindow.c | 4 +++- dlls/mshtml/tests/events.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c index df6c5cf..ca45524 100644 --- a/dlls/mshtml/conpoint.c +++ b/dlls/mshtml/conpoint.c @@ -266,7 +266,7 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo TRACE("(%p)->(%s %p)\n", This, debugstr_cp_guid(riid), ppCP);
if(This->forward_container) - return IConnectionPointContainer_FindConnectionPoint(&This->IConnectionPointContainer_iface, + return IConnectionPointContainer_FindConnectionPoint(&This->forward_container->IConnectionPointContainer_iface, riid, ppCP);
*ppCP = NULL; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index d0d378f..a4fa1be 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -40,6 +40,8 @@ static struct list window_list = LIST_INIT(window_list); static void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node) { if(window->doc) { + if(window->doc_obj && window == window->doc_obj->basedoc.window) + window->doc->basedoc.cp_container.forward_container = NULL; abort_document_bindings(window->doc); window->doc->basedoc.window = NULL; htmldoc_release(&window->doc->basedoc); @@ -2245,6 +2247,7 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML list_init(&window->script_hosts);
window->task_magic = get_task_target_magic(); + *ret = window; update_window_doc(window);
list_init(&window->children); @@ -2257,7 +2260,6 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML list_add_tail(&parent->children, &window->sibling_entry); }
- *ret = window; return S_OK; }
diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index b1d1423..bdb8460 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -2407,7 +2407,7 @@ static void test_empty_document(void) cp = get_cp((IUnknown*)doc, &IID_IDispatch); hres = IConnectionPoint_Unadvise(cp, cookie); IConnectionPoint_Release(cp); - todo_wine ok(hres == S_OK, "Unadvise failed: %08x\n", hres); + ok(hres == S_OK, "Unadvise failed: %08x\n", hres);
IHTMLDocument2_Release(windows_doc); }