mshtml: Handle fClearDirty flag in IPersistStreamInit::Save.

This commit is contained in:
Jacek Caban 2008-01-10 12:53:38 +01:00 committed by Alexandre Julliard
parent 7de847c6ee
commit c58ca1312c
3 changed files with 10 additions and 6 deletions

View file

@ -99,11 +99,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static const WCHAR wszFont[] = {'f','o','n','t',0};
static const WCHAR wszSize[] = {'s','i','z','e',0};
static void set_dirty(HTMLDocument *This, VARIANT_BOOL dirty)
void set_dirty(HTMLDocument *This, VARIANT_BOOL dirty)
{
nsresult nsres;
if(!This->nscontainer || !This->nscontainer->editor)
if(This->usermode != EDITMODE || !This->nscontainer || !This->nscontainer->editor)
return;
if(dirty) {
@ -976,7 +976,7 @@ static HRESULT exec_setdirty(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
{
TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out);
if(!in || This->usermode != EDITMODE)
if(!in)
return S_OK;
if(V_VT(in) == VT_BOOL)

View file

@ -490,8 +490,9 @@ void handle_edit_event(HTMLDocument*,nsIDOMEvent*);
HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
HRESULT editor_exec_paste(HTMLDocument*,DWORD,VARIANT*,VARIANT*);
void handle_edit_load(HTMLDocument *This);
void handle_edit_load(HTMLDocument*);
HRESULT editor_is_dirty(HTMLDocument*);
void set_dirty(HTMLDocument*,VARIANT_BOOL);
extern DWORD mshtml_tls;

View file

@ -705,18 +705,21 @@ static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM
DWORD len, written=0;
HRESULT hres;
WARN("(%p)->(%p %x) needs more work\n", This, pStm, fClearDirty);
TRACE("(%p)->(%p %x)\n", This, pStm, fClearDirty);
hres = get_doc_string(This, &str, &len);
if(FAILED(hres))
return hres;
hres = IStream_Write(pStm, str, len, &written);
if(FAILED(hres))
FIXME("Write failed: %08x\n", hres);
heap_free(str);
if(fClearDirty)
set_dirty(This, VARIANT_FALSE);
return S_OK;
}