Commit 54d2a447 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Store current moniker in HTMLDocument.

parent 8d4c839a
......@@ -159,6 +159,7 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
IOleDocumentView_SetInPlaceSite(DOCVIEW(This), NULL);
set_document_bscallback(This, NULL);
set_current_mon(This, NULL);
if(This->tooltips_hwnd)
DestroyWindow(This->tooltips_hwnd);
......
......@@ -101,6 +101,7 @@ struct HTMLDocument {
IOleInPlaceFrame *frame;
BSCallback *bscallback;
IMoniker *mon;
HWND hwnd;
HWND tooltips_hwnd;
......@@ -353,6 +354,7 @@ BSCallback *create_bscallback(IMoniker*);
HRESULT start_binding(BSCallback*);
HRESULT load_stream(BSCallback*,IStream*);
void set_document_bscallback(HTMLDocument*,BSCallback*);
void set_current_mon(HTMLDocument*,IMoniker*);
IHlink *Hlink_Create(void);
IHTMLSelectionObject *HTMLSelectionObject_Create(nsISelection*);
......
......@@ -690,6 +690,11 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
return This->channel
? nsIChannel_AsyncOpen(This->channel, aListener, aContext)
: NS_ERROR_UNEXPECTED;
hres = create_mon_for_nschannel(This, &mon);
if(FAILED(hres))
return NS_ERROR_UNEXPECTED;
set_current_mon(container->doc, mon);
}
}
......@@ -715,6 +720,9 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
nsres = nsIChannel_AsyncOpen(This->channel, aListener, aContext);
if(mon)
IMoniker_Release(mon);
if(NS_FAILED(nsres) && (This->load_flags & LOAD_INITIAL_DOCUMENT_URI))
return WINE_NS_LOAD_FROM_MONIKER;
return nsres;
......
......@@ -113,6 +113,15 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
return ret;
}
void set_current_mon(HTMLDocument *This, IMoniker *mon)
{
if(This->mon)
IMoniker_Release(This->mon);
if(mon)
IMoniker_AddRef(mon);
This->mon = mon;
}
static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BOOL *bind_complete)
{
BSCallback *bscallback;
......@@ -165,6 +174,8 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
TRACE("got url: %s\n", debugstr_w(url));
set_current_mon(This, mon);
if(This->client) {
VARIANT silent, offline;
IOleCommandTarget *cmdtrg = NULL;
......@@ -655,4 +666,5 @@ void HTMLDocument_Persist_Init(HTMLDocument *This)
This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
This->bscallback = NULL;
This->mon = NULL;
}
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