Commit 979b42d7 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Don't access BSCallback directly in nsembed.c.

parent f792ada4
...@@ -435,6 +435,7 @@ void set_document_bscallback(HTMLDocument*,BSCallback*); ...@@ -435,6 +435,7 @@ void set_document_bscallback(HTMLDocument*,BSCallback*);
void set_current_mon(HTMLDocument*,IMoniker*); void set_current_mon(HTMLDocument*,IMoniker*);
void channelbsc_set_channel(BSCallback*,nsChannel*,nsIStreamListener*,nsISupports*); void channelbsc_set_channel(BSCallback*,nsChannel*,nsIStreamListener*,nsISupports*);
IMoniker *get_channelbsc_mon(BSCallback*);
IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument*,nsISelection*); IHTMLSelectionObject *HTMLSelectionObject_Create(HTMLDocument*,nsISelection*);
IHTMLTxtRange *HTMLTxtRange_Create(HTMLDocument*,nsIDOMRange*); IHTMLTxtRange *HTMLTxtRange_Create(HTMLDocument*,nsIDOMRange*);
......
...@@ -866,6 +866,13 @@ HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback, IBindCtx *bctx) ...@@ -866,6 +866,13 @@ HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback, IBindCtx *bctx)
return S_OK; return S_OK;
} }
IMoniker *get_channelbsc_mon(BSCallback *This)
{
if(This->mon)
IMoniker_AddRef(This->mon);
return This->mon;
}
void set_document_bscallback(HTMLDocument *doc, BSCallback *callback) void set_document_bscallback(HTMLDocument *doc, BSCallback *callback)
{ {
BSCallback *iter; BSCallback *iter;
......
...@@ -1138,16 +1138,22 @@ static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener ...@@ -1138,16 +1138,22 @@ static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener
nsIWineURI_SetNSContainer(wine_uri, This); nsIWineURI_SetNSContainer(wine_uri, This);
nsIWineURI_SetIsDocumentURI(wine_uri, TRUE); nsIWineURI_SetIsDocumentURI(wine_uri, TRUE);
if(This->bscallback && This->bscallback->mon) { if(This->bscallback) {
LPWSTR wine_url; IMoniker *mon = get_channelbsc_mon(This->bscallback);
HRESULT hres;
if(mon) {
hres = IMoniker_GetDisplayName(This->bscallback->mon, NULL, 0, &wine_url); LPWSTR wine_url;
if(SUCCEEDED(hres)) { HRESULT hres;
nsIWineURI_SetWineURL(wine_uri, wine_url);
CoTaskMemFree(wine_url); hres = IMoniker_GetDisplayName(mon, NULL, 0, &wine_url);
}else { if(SUCCEEDED(hres)) {
WARN("GetDisplayName failed: %08x\n", hres); nsIWineURI_SetWineURL(wine_uri, wine_url);
CoTaskMemFree(wine_url);
}else {
WARN("GetDisplayName failed: %08x\n", hres);
}
IMoniker_Release(mon);
} }
} }
......
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