Jacek Caban : mshtml: Use stored nsdoc in IHTMLElement::insertAdjacentHTML.

Alexandre Julliard julliard at winehq.org
Fri Oct 10 08:06:35 CDT 2008


Module: wine
Branch: master
Commit: ccef2eab80434f77a5e6b2de797cb407c360c111
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ccef2eab80434f77a5e6b2de797cb407c360c111

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Oct  9 15:25:31 2008 -0500

mshtml: Use stored nsdoc in IHTMLElement::insertAdjacentHTML.

---

 dlls/mshtml/htmlelem.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index f11c235..0a5c686 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -918,26 +918,22 @@ static HRESULT WINAPI HTMLElement_insertAdjacentHTML(IHTMLElement *iface, BSTR w
                                                      BSTR html)
 {
     HTMLElement *This = HTMLELEM_THIS(iface);
-    nsresult nsres;
-    nsIDOMDocument *nsdoc;
     nsIDOMDocumentRange *nsdocrange;
     nsIDOMRange *range;
     nsIDOMNSRange *nsrange;
     nsIDOMNode *nsnode;
     nsAString ns_html;
+    nsresult nsres;
     HRESULT hr;
 
     TRACE("(%p)->(%s %s)\n", This, debugstr_w(where), debugstr_w(html));
 
-    nsres = nsIWebNavigation_GetDocument(This->node.doc->nscontainer->navigation, &nsdoc);
-    if(NS_FAILED(nsres))
-    {
-        ERR("GetDocument failed: %08x\n", nsres);
-        return E_FAIL;
+    if(!This->node.doc->nsdoc) {
+        WARN("NULL nsdoc\n");
+        return E_UNEXPECTED;
     }
 
-    nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentRange, (void **)&nsdocrange);
-    nsIDOMDocument_Release(nsdoc);
+    nsres = nsIDOMDocument_QueryInterface(This->node.doc->nsdoc, &IID_nsIDOMDocumentRange, (void **)&nsdocrange);
     if(NS_FAILED(nsres))
     {
         ERR("getting nsIDOMDocumentRange failed: %08x\n", nsres);




More information about the wine-cvs mailing list