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

mshtml: Use stored nsdoc in IHTMLTxtRange::put_text.

parent 16f2965e
...@@ -1093,7 +1093,6 @@ static HRESULT WINAPI HTMLTxtRange_get_htmlText(IHTMLTxtRange *iface, BSTR *p) ...@@ -1093,7 +1093,6 @@ static HRESULT WINAPI HTMLTxtRange_get_htmlText(IHTMLTxtRange *iface, BSTR *p)
static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v) static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v)
{ {
HTMLTxtRange *This = HTMLTXTRANGE_THIS(iface); HTMLTxtRange *This = HTMLTXTRANGE_THIS(iface);
nsIDOMDocument *nsdoc;
nsIDOMText *text_node; nsIDOMText *text_node;
nsAString text_str; nsAString text_str;
nsresult nsres; nsresult nsres;
...@@ -1103,15 +1102,8 @@ static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v) ...@@ -1103,15 +1102,8 @@ static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v)
if(!This->doc) if(!This->doc)
return MSHTML_E_NODOC; 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); nsAString_Init(&text_str, v);
nsres = nsIDOMDocument_CreateTextNode(nsdoc, &text_str, &text_node); nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc->nsdoc, &text_str, &text_node);
nsIDOMDocument_Release(nsdoc);
nsAString_Finish(&text_str); nsAString_Finish(&text_str);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
ERR("CreateTextNode failed: %08x\n", nsres); ERR("CreateTextNode failed: %08x\n", nsres);
......
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