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

mshtml: Handle fClearDirty flag in IPersistStreamInit::Save.

parent 7de847c6
......@@ -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)
......
......@@ -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;
......
......@@ -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;
}
......
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