From 05d199474b03936bbfb02588e1b785584f7a37c3 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 16 Sep 2009 22:12:41 +0200 Subject: [PATCH] mshtml: Move readystate to HTMLDocumentObj. --- dlls/mshtml/editor.c | 6 +++--- dlls/mshtml/htmldoc.c | 6 +++--- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/olecmd.c | 2 +- dlls/mshtml/persist.c | 2 +- dlls/mshtml/task.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index 245e8d8124..d1d9aadae3 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -150,7 +150,7 @@ static DWORD query_ns_edit_status(HTMLDocument *This, const char *nscmd) nsICommandParams *nsparam; PRBool b = FALSE; - if(This->doc_obj->usermode != EDITMODE || This->readystate < READYSTATE_INTERACTIVE) + if(This->doc_obj->usermode != EDITMODE || This->doc_obj->readystate < READYSTATE_INTERACTIVE) return OLECMDF_SUPPORTED; if(This->doc_obj->nscontainer && nscmd) { @@ -185,7 +185,7 @@ static DWORD query_align_status(HTMLDocument *This, const char *align_str) nsICommandParams *nsparam; char *align = NULL; - if(This->doc_obj->usermode != EDITMODE || This->readystate < READYSTATE_INTERACTIVE) + if(This->doc_obj->usermode != EDITMODE || This->doc_obj->readystate < READYSTATE_INTERACTIVE) return OLECMDF_SUPPORTED; if(This->doc_obj->nscontainer) { @@ -715,7 +715,7 @@ static HRESULT query_justify(HTMLDocument *This, OLECMD *cmd) case IDM_JUSTIFYLEFT: TRACE("(%p) IDM_JUSTIFYLEFT\n", This); /* FIXME: We should set OLECMDF_LATCHED only if it's set explicitly. */ - if(This->doc_obj->usermode != EDITMODE || This->readystate < READYSTATE_INTERACTIVE) + if(This->doc_obj->usermode != EDITMODE || This->doc_obj->readystate < READYSTATE_INTERACTIVE) cmd->cmdf = OLECMDF_SUPPORTED; else cmd->cmdf = OLECMDF_SUPPORTED | OLECMDF_ENABLED; diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 87299450bd..95b0100fd0 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -454,7 +454,7 @@ static HRESULT WINAPI HTMLDocument_get_readyState(IHTMLDocument2 *iface, BSTR *p if(!p) return E_POINTER; - *p = SysAllocString(readystate_str[This->readystate]); + *p = SysAllocString(readystate_str[This->doc_obj->readystate]); return S_OK; } @@ -1512,7 +1512,7 @@ static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMemb return E_INVALIDARG; V_VT(pVarResult) = VT_I4; - V_I4(pVarResult) = This->readystate; + V_I4(pVarResult) = This->doc_obj->readystate; return S_OK; } @@ -1737,7 +1737,6 @@ static void init_doc(HTMLDocument *doc, const htmldoc_vtbl_t *vtbl) doc->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl; doc->lpIDispatchExVtbl = &DocDispatchExVtbl; doc->lpSupportErrorInfoVtbl = &SupportErrorInfoVtbl; - doc->readystate = READYSTATE_UNINITIALIZED; HTMLDocument_HTMLDocument3_Init(doc); HTMLDocument_HTMLDocument5_Init(doc); @@ -1941,6 +1940,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) doc->nscontainer = NSContainer_Create(doc, NULL); list_init(&doc->bindings); doc->usermode = UNKNOWN_USERMODE; + doc->readystate = READYSTATE_UNINITIALIZED; if(doc->nscontainer) { nsresult nsres; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index fc664267e9..c8d1c61307 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -284,7 +284,6 @@ struct HTMLDocument { HTMLWindow *window; nsIDOMHTMLDocument *nsdoc; - READYSTATE readystate; LPWSTR mime; DWORD update; @@ -350,6 +349,7 @@ struct HTMLDocumentObj { BOOL focus; USERMODE usermode; + READYSTATE readystate; /* FIXME: probably should be in document node object */ nsChannelBSC *bscallback; diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index dc3e6386c6..c2f6fef22b 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -555,7 +555,7 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, if(This->doc_obj->frame) IOleInPlaceFrame_SetStatusText(This->doc_obj->frame, NULL); - This->readystate = READYSTATE_UNINITIALIZED; + This->doc_obj->readystate = READYSTATE_UNINITIALIZED; if(This->doc_obj->client) { IOleCommandTarget *cmdtrg; diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 6fa9283d9e..0ce29c4d5b 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -113,7 +113,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO } } - This->readystate = READYSTATE_LOADING; + This->doc_obj->readystate = READYSTATE_LOADING; call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE); update_doc(This, UPDATE_TITLE); diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index 331a9d3313..a387e6ac65 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -263,7 +263,7 @@ static void set_parsecomplete(HTMLDocument *doc) /* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */ - doc->readystate = READYSTATE_INTERACTIVE; + doc->doc_obj->readystate = READYSTATE_INTERACTIVE; call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE); if(doc->doc_obj->client) @@ -289,7 +289,7 @@ static void set_parsecomplete(HTMLDocument *doc) IOleCommandTarget_Release(olecmd); } - doc->readystate = READYSTATE_COMPLETE; + doc->doc_obj->readystate = READYSTATE_COMPLETE; call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE); if(doc->doc_obj->frame) {