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

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


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

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

mshtml: Use stored nsdoc in IHTMLElement::insertAdjacentText.

---

 dlls/mshtml/htmlelem.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index 0a5c686..7967d62 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -979,25 +979,21 @@ static HRESULT WINAPI HTMLElement_insertAdjacentText(IHTMLElement *iface, BSTR w
                                                      BSTR text)
 {
     HTMLElement *This = HTMLELEM_THIS(iface);
-    nsresult nsres;
-    nsIDOMDocument *nsdoc;
     nsIDOMNode *nsnode;
     nsAString ns_text;
+    nsresult nsres;
     HRESULT hr;
 
     TRACE("(%p)->(%s %s)\n", This, debugstr_w(where), debugstr_w(text));
 
-    nsres = nsIWebNavigation_GetDocument(This->node.doc->nscontainer->navigation, &nsdoc);
-    if(NS_FAILED(nsres) || !nsdoc)
-    {
-        ERR("GetDocument failed: %08x\n", nsres);
-        return E_FAIL;
+    if(!This->node.doc->nsdoc) {
+        WARN("NULL nsdoc\n");
+        return E_UNEXPECTED;
     }
 
-    nsAString_Init(&ns_text, text);
 
-    nsres = nsIDOMDocument_CreateTextNode(nsdoc, &ns_text, (nsIDOMText **)&nsnode);
-    nsIDOMDocument_Release(nsdoc);
+    nsAString_Init(&ns_text, text);
+    nsres = nsIDOMDocument_CreateTextNode(This->node.doc->nsdoc, &ns_text, (nsIDOMText **)&nsnode);
     nsAString_Finish(&ns_text);
 
     if(NS_FAILED(nsres) || !nsnode)




More information about the wine-cvs mailing list