mshtml: Correctly forward IHTMLWindow's IHTMLDocument's ConnectionPointContainer.

This commit is contained in:
Thomas Mullaly 2011-02-26 23:55:16 -05:00 committed by Alexandre Julliard
parent 1571097ed3
commit a46e0c617b
3 changed files with 5 additions and 3 deletions

View File

@ -266,7 +266,7 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
TRACE("(%p)->(%s %p)\n", This, debugstr_cp_guid(riid), ppCP); TRACE("(%p)->(%s %p)\n", This, debugstr_cp_guid(riid), ppCP);
if(This->forward_container) if(This->forward_container)
return IConnectionPointContainer_FindConnectionPoint(&This->IConnectionPointContainer_iface, return IConnectionPointContainer_FindConnectionPoint(&This->forward_container->IConnectionPointContainer_iface,
riid, ppCP); riid, ppCP);
*ppCP = NULL; *ppCP = NULL;

View File

@ -40,6 +40,8 @@ static struct list window_list = LIST_INIT(window_list);
static void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node) static void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node)
{ {
if(window->doc) { 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); abort_document_bindings(window->doc);
window->doc->basedoc.window = NULL; window->doc->basedoc.window = NULL;
htmldoc_release(&window->doc->basedoc); htmldoc_release(&window->doc->basedoc);
@ -2245,6 +2247,7 @@ HRESULT HTMLWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HTML
list_init(&window->script_hosts); list_init(&window->script_hosts);
window->task_magic = get_task_target_magic(); window->task_magic = get_task_target_magic();
*ret = window;
update_window_doc(window); update_window_doc(window);
list_init(&window->children); 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); list_add_tail(&parent->children, &window->sibling_entry);
} }
*ret = window;
return S_OK; return S_OK;
} }

View File

@ -2407,7 +2407,7 @@ static void test_empty_document(void)
cp = get_cp((IUnknown*)doc, &IID_IDispatch); cp = get_cp((IUnknown*)doc, &IID_IDispatch);
hres = IConnectionPoint_Unadvise(cp, cookie); hres = IConnectionPoint_Unadvise(cp, cookie);
IConnectionPoint_Release(cp); 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); IHTMLDocument2_Release(windows_doc);
} }