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

mshtml: Use stored nsdoc in createRange.

parent 7a74f5b5
...@@ -150,23 +150,16 @@ static HRESULT WINAPI HTMLSelectionObject_createRange(IHTMLSelectionObject *ifac ...@@ -150,23 +150,16 @@ static HRESULT WINAPI HTMLSelectionObject_createRange(IHTMLSelectionObject *ifac
nsISelection_GetRangeCount(This->nsselection, &nsrange_cnt); nsISelection_GetRangeCount(This->nsselection, &nsrange_cnt);
if(!nsrange_cnt) { if(!nsrange_cnt) {
nsIDOMDocument *nsdoc;
nsIDOMHTMLDocument *nshtmldoc;
nsIDOMHTMLElement *nsbody = NULL; nsIDOMHTMLElement *nsbody = NULL;
TRACE("nsrange_cnt = 0\n"); TRACE("nsrange_cnt = 0\n");
nsres = nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc); if(!This->doc->nsdoc) {
if(NS_FAILED(nsres) || !nsdoc) { WARN("nsdoc is NULL\n");
ERR("GetDocument failed: %08x\n", nsres); return E_UNEXPECTED;
return E_FAIL;
} }
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc); nsres = nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nsbody);
nsIDOMDocument_Release(nsdoc);
nsres = nsIDOMHTMLDocument_GetBody(nshtmldoc, &nsbody);
nsIDOMHTMLDocument_Release(nshtmldoc);
if(NS_FAILED(nsres) || !nsbody) { if(NS_FAILED(nsres) || !nsbody) {
ERR("Could not get body: %08x\n", nsres); ERR("Could not get body: %08x\n", nsres);
return E_FAIL; return E_FAIL;
......
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