Commit f7910c93 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Moved more code to handle_docobj_load.

parent 6fff7e7c
......@@ -178,11 +178,18 @@ static nsresult NSAPI handle_keypress(nsIDOMEventListener *iface,
static void handle_docobj_load(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd = NULL;
HRESULT hres;
if(!doc->client)
return;
if(doc->nscontainer->editor_controller) {
nsIController_Release(doc->nscontainer->editor_controller);
doc->nscontainer->editor_controller = NULL;
}
if(doc->usermode == EDITMODE)
handle_edit_load(&doc->basedoc);
if(doc->client) {
IOleCommandTarget *olecmd = NULL;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(SUCCEEDED(hres)) {
......@@ -206,37 +213,32 @@ static void handle_docobj_load(HTMLDocumentObj *doc)
IOleCommandTarget_Release(olecmd);
}
}
doc->download_state = 0;
}
static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event)
{
HTMLDocumentNode *doc = NSEVENTLIST_THIS(iface)->This->doc;
HTMLDocumentObj *doc_obj;
nsIDOMHTMLElement *nsbody = NULL;
HTMLDocumentObj *doc_obj = NULL;
TRACE("(%p)\n", doc);
if(!doc || !doc->basedoc.window)
return NS_ERROR_FAILURE;
if(doc->basedoc.doc_obj && doc->basedoc.doc_obj->basedoc.doc_node == doc)
doc_obj = doc->basedoc.doc_obj;
connect_scripts(doc->basedoc.window);
if(doc_obj->nscontainer->editor_controller) {
nsIController_Release(doc_obj->nscontainer->editor_controller);
doc_obj->nscontainer->editor_controller = NULL;
}
if(doc_obj->usermode == EDITMODE)
handle_edit_load(&doc_obj->basedoc);
if(doc == doc_obj->basedoc.doc_node)
if(doc_obj)
handle_docobj_load(doc_obj);
set_ready_state(doc->basedoc.window, READYSTATE_COMPLETE);
if(doc == doc_obj->basedoc.doc_node) {
if(doc_obj) {
if(doc_obj->view_sink)
IAdviseSink_OnViewChange(doc_obj->view_sink, DVASPECT_CONTENT, -1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment