Module: wine Branch: master Commit: ff0d147b22aaf6598edf37aaa58fcbecd3d9547c URL: http://source.winehq.org/git/wine.git/?a=commit;h=ff0d147b22aaf6598edf37aaa5...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Sep 16 22:06:56 2009 +0200
mshtml: Use stored HTMLWindow in get_selection implementation.
---
dlls/mshtml/htmldoc.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index f75ea4b..9eea254 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -417,18 +417,15 @@ static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p) { HTMLDocument *This = HTMLDOC_THIS(iface); - nsISelection *nsselection = NULL; + nsISelection *nsselection; + nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
- if(This->nscontainer) { - nsIDOMWindow *dom_window = NULL; - - nsIWebBrowser_GetContentDOMWindow(This->nscontainer->webbrowser, &dom_window); - if(dom_window) { - nsIDOMWindow_GetSelection(dom_window, &nsselection); - nsIDOMWindow_Release(dom_window); - } + nsres = nsIDOMWindow_GetSelection(This->window->nswindow, &nsselection); + if(NS_FAILED(nsres)) { + ERR("GetSelection failed: %08x\n", nsres); + return E_FAIL; }
*p = HTMLSelectionObject_Create(This, nsselection);