Jacek Caban : mshtml: Use stored nsdoc in IHTMLTxtRange::put_text.

Alexandre Julliard julliard at winehq.org
Thu Oct 9 07:42:56 CDT 2008


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Oct  8 13:30:10 2008 -0500

mshtml: Use stored nsdoc in IHTMLTxtRange::put_text.

---

 dlls/mshtml/txtrange.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/dlls/mshtml/txtrange.c b/dlls/mshtml/txtrange.c
index b146437..c35834f 100644
--- a/dlls/mshtml/txtrange.c
+++ b/dlls/mshtml/txtrange.c
@@ -1093,7 +1093,6 @@ static HRESULT WINAPI HTMLTxtRange_get_htmlText(IHTMLTxtRange *iface, BSTR *p)
 static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v)
 {
     HTMLTxtRange *This = HTMLTXTRANGE_THIS(iface);
-    nsIDOMDocument *nsdoc;
     nsIDOMText *text_node;
     nsAString text_str;
     nsresult nsres;
@@ -1103,15 +1102,8 @@ static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v)
     if(!This->doc)
         return MSHTML_E_NODOC;
 
-    nsres = nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc);
-    if(NS_FAILED(nsres)) {
-        ERR("GetDocument failed: %08x\n", nsres);
-        return S_OK;
-    }
-
     nsAString_Init(&text_str, v);
-    nsres = nsIDOMDocument_CreateTextNode(nsdoc, &text_str, &text_node);
-    nsIDOMDocument_Release(nsdoc);
+    nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc->nsdoc, &text_str, &text_node);
     nsAString_Finish(&text_str);
     if(NS_FAILED(nsres)) {
         ERR("CreateTextNode failed: %08x\n", nsres);




More information about the wine-cvs mailing list