From 4ecf80fd0b65ef1c894ff66f7aa8dfacb7f95346 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sat, 13 Mar 2010 16:43:48 +0100 Subject: [PATCH] shdocvw: Separate document state from control state. --- dlls/shdocvw/dochost.c | 17 ++++++++++++----- dlls/shdocvw/navigate.c | 2 +- dlls/shdocvw/shdocvw.h | 2 ++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/shdocvw/dochost.c b/dlls/shdocvw/dochost.c index 6eb8199636..87565271ce 100644 --- a/dlls/shdocvw/dochost.c +++ b/dlls/shdocvw/dochost.c @@ -159,16 +159,23 @@ static void advise_prop_notif(DocHost *This, BOOL set) This->is_prop_notif = set; } +void set_doc_state(DocHost *This, READYSTATE doc_state) +{ + This->doc_state = doc_state; + if(doc_state > This->ready_state) + This->ready_state = doc_state; +} + static void update_ready_state(DocHost *This, READYSTATE ready_state) { - if(ready_state > READYSTATE_LOADING && This->ready_state <= READYSTATE_LOADING) { + if(ready_state > READYSTATE_LOADING && This->doc_state <= READYSTATE_LOADING) notif_complete(This, DISPID_NAVIGATECOMPLETE2); - This->ready_state = ready_state; - } - if(ready_state == READYSTATE_COMPLETE && This->ready_state < READYSTATE_COMPLETE) { - This->ready_state = READYSTATE_COMPLETE; + if(ready_state == READYSTATE_COMPLETE && This->doc_state < READYSTATE_COMPLETE) { + set_doc_state(This, READYSTATE_COMPLETE); notif_complete(This, DISPID_DOCUMENTCOMPLETE); + }else { + set_doc_state(This, ready_state); } } diff --git a/dlls/shdocvw/navigate.c b/dlls/shdocvw/navigate.c index ec23fcc7b3..456cd83aef 100644 --- a/dlls/shdocvw/navigate.c +++ b/dlls/shdocvw/navigate.c @@ -549,7 +549,7 @@ static HRESULT navigate_bsc(DocHost *This, BindStatusCallback *bsc, IMoniker *mo VARIANT_BOOL cancel = VARIANT_FALSE; HRESULT hres; - This->ready_state = READYSTATE_LOADING; + set_doc_state(This, READYSTATE_LOADING); on_before_navigate2(This, bsc->url, bsc->post_data, bsc->post_data_len, bsc->headers, &cancel); if(cancel) { diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h index 1641222601..1184298dca 100644 --- a/dlls/shdocvw/shdocvw.h +++ b/dlls/shdocvw/shdocvw.h @@ -104,6 +104,7 @@ struct DocHost { VARIANT_BOOL busy; READYSTATE ready_state; + READYSTATE doc_state; DWORD prop_notif_cookie; BOOL is_prop_notif; @@ -223,6 +224,7 @@ HRESULT dochost_object_available(DocHost*,IUnknown*); void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*); HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*); HRESULT go_home(DocHost*); +void set_doc_state(DocHost*,READYSTATE); #define WM_DOCHOSTTASK (WM_USER+0x300) void push_dochost_task(DocHost*,task_header_t*,task_proc_t,BOOL);