mshtml: Use stored nsdoc in createTextNode.
This commit is contained in:
parent
9f1d3b21da
commit
4f08c4f09b
|
@ -103,7 +103,6 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
|
||||||
IHTMLDOMNode **newTextNode)
|
IHTMLDOMNode **newTextNode)
|
||||||
{
|
{
|
||||||
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
||||||
nsIDOMDocument *nsdoc;
|
|
||||||
nsIDOMText *nstext;
|
nsIDOMText *nstext;
|
||||||
HTMLDOMNode *node;
|
HTMLDOMNode *node;
|
||||||
nsAString text_str;
|
nsAString text_str;
|
||||||
|
@ -111,12 +110,14 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
|
||||||
|
|
||||||
TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
|
TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
|
||||||
|
|
||||||
nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
if(!This->nsdoc) {
|
||||||
|
WARN("NULL nsdoc\n");
|
||||||
|
return E_UNEXPECTED;
|
||||||
|
}
|
||||||
|
|
||||||
nsAString_Init(&text_str, text);
|
nsAString_Init(&text_str, text);
|
||||||
nsres = nsIDOMDocument_CreateTextNode(nsdoc, &text_str, &nstext);
|
nsres = nsIDOMHTMLDocument_CreateTextNode(This->nsdoc, &text_str, &nstext);
|
||||||
nsAString_Finish(&text_str);
|
nsAString_Finish(&text_str);
|
||||||
nsIDOMDocument_Release(nsdoc);
|
|
||||||
if(NS_FAILED(nsres)) {
|
if(NS_FAILED(nsres)) {
|
||||||
ERR("CreateTextNode failed: %08x\n", nsres);
|
ERR("CreateTextNode failed: %08x\n", nsres);
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
Loading…
Reference in New Issue