mshtml: Use stored HTMLWindow in get_selection implementation.
This commit is contained in:
parent
11eb1b0840
commit
ff0d147b22
|
@ -417,18 +417,15 @@ static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p
|
||||||
static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p)
|
static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p)
|
||||||
{
|
{
|
||||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||||
nsISelection *nsselection = NULL;
|
nsISelection *nsselection;
|
||||||
|
nsresult nsres;
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, p);
|
TRACE("(%p)->(%p)\n", This, p);
|
||||||
|
|
||||||
if(This->nscontainer) {
|
nsres = nsIDOMWindow_GetSelection(This->window->nswindow, &nsselection);
|
||||||
nsIDOMWindow *dom_window = NULL;
|
if(NS_FAILED(nsres)) {
|
||||||
|
ERR("GetSelection failed: %08x\n", nsres);
|
||||||
nsIWebBrowser_GetContentDOMWindow(This->nscontainer->webbrowser, &dom_window);
|
return E_FAIL;
|
||||||
if(dom_window) {
|
|
||||||
nsIDOMWindow_GetSelection(dom_window, &nsselection);
|
|
||||||
nsIDOMWindow_Release(dom_window);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*p = HTMLSelectionObject_Create(This, nsselection);
|
*p = HTMLSelectionObject_Create(This, nsselection);
|
||||||
|
|
Loading…
Reference in New Issue