mshtml: Move Exec(OLECMDID_SETTITLE) call to separated function and use it in on_timer.
This commit is contained in:
parent
d8e518eb68
commit
20d77432a2
|
@ -388,6 +388,7 @@ extern const cmdtable_t editmode_cmds[];
|
|||
#define UPDATE_TITLE 0x0002
|
||||
|
||||
void update_doc(HTMLDocument *This, DWORD flags);
|
||||
void update_title(HTMLDocument*);
|
||||
|
||||
/* editor */
|
||||
void set_ns_editmode(NSContainer*);
|
||||
|
|
|
@ -153,6 +153,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
|
|||
|
||||
This->readystate = READYSTATE_LOADING;
|
||||
call_property_onchanged(This->cp_propnotif, DISPID_READYSTATE);
|
||||
update_doc(This, UPDATE_TITLE);
|
||||
|
||||
HTMLDocument_LockContainer(This, TRUE);
|
||||
|
||||
|
|
|
@ -155,6 +155,8 @@ static void set_parsecomplete(HTMLDocument *doc)
|
|||
|
||||
IOleCommandTarget_Exec(olecmd, &CGID_MSHTML, IDM_PARSECOMPLETE, 0, NULL, NULL);
|
||||
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_HTTPEQUIV_DONE, 0, NULL, NULL);
|
||||
|
||||
IOleCommandTarget_Release(olecmd);
|
||||
}
|
||||
|
||||
doc->readystate = READYSTATE_COMPLETE;
|
||||
|
@ -165,18 +167,7 @@ static void set_parsecomplete(HTMLDocument *doc)
|
|||
IOleInPlaceFrame_SetStatusText(doc->frame, wszDone);
|
||||
}
|
||||
|
||||
if(olecmd) {
|
||||
VARIANT title;
|
||||
WCHAR empty[] = {0};
|
||||
|
||||
V_VT(&title) = VT_BSTR;
|
||||
V_BSTR(&title) = SysAllocString(empty);
|
||||
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETTITLE, OLECMDEXECOPT_DONTPROMPTUSER,
|
||||
&title, NULL);
|
||||
SysFreeString(V_BSTR(&title));
|
||||
|
||||
IOleCommandTarget_Release(olecmd);
|
||||
}
|
||||
update_title(doc);
|
||||
}
|
||||
|
||||
static void set_progress(HTMLDocument *doc)
|
||||
|
|
|
@ -104,6 +104,34 @@ void update_doc(HTMLDocument *This, DWORD flags)
|
|||
This->update |= flags;
|
||||
}
|
||||
|
||||
void update_title(HTMLDocument *This)
|
||||
{
|
||||
IOleCommandTarget *olecmd;
|
||||
HRESULT hres;
|
||||
|
||||
if(!(This->update & UPDATE_TITLE))
|
||||
return;
|
||||
|
||||
This->update &= ~UPDATE_TITLE;
|
||||
|
||||
if(!This->client)
|
||||
return;
|
||||
|
||||
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&olecmd);
|
||||
if(SUCCEEDED(hres)) {
|
||||
VARIANT title;
|
||||
WCHAR empty[] = {0};
|
||||
|
||||
V_VT(&title) = VT_BSTR;
|
||||
V_BSTR(&title) = SysAllocString(empty);
|
||||
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETTITLE, OLECMDEXECOPT_DONTPROMPTUSER,
|
||||
&title, NULL);
|
||||
SysFreeString(V_BSTR(&title));
|
||||
|
||||
IOleCommandTarget_Release(olecmd);
|
||||
}
|
||||
}
|
||||
|
||||
static LRESULT on_timer(HTMLDocument *This)
|
||||
{
|
||||
TRACE("(%p) %x\n", This, This->update);
|
||||
|
@ -131,6 +159,7 @@ static LRESULT on_timer(HTMLDocument *This)
|
|||
}
|
||||
}
|
||||
|
||||
update_title(This);
|
||||
This->update = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue