mshtml: Use stored nsdoc in exec_indent.

This commit is contained in:
Jacek Caban 2008-10-09 15:25:23 -05:00 committed by Alexandre Julliard
parent 08efe6de3e
commit 8423450ccf
1 changed files with 6 additions and 6 deletions

View File

@ -1746,7 +1746,6 @@ static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
{ {
nsIDOMDocumentFragment *fragment; nsIDOMDocumentFragment *fragment;
nsIDOMElement *blockquote_elem, *p_elem; nsIDOMElement *blockquote_elem, *p_elem;
nsIDOMDocument *nsdoc;
nsIDOMNode *tmp; nsIDOMNode *tmp;
nsAString tag_str; nsAString tag_str;
@ -1755,18 +1754,19 @@ static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
TRACE("(%p)->(%p %p)\n", This, in, out); TRACE("(%p)->(%p %p)\n", This, in, out);
nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc); if(!This->doc->nsdoc) {
WARN("NULL nsdoc\n");
return E_NOTIMPL;
}
nsAString_Init(&tag_str, blockquoteW); nsAString_Init(&tag_str, blockquoteW);
nsIDOMDocument_CreateElement(nsdoc, &tag_str, &blockquote_elem); nsIDOMHTMLDocument_CreateElement(This->doc->nsdoc, &tag_str, &blockquote_elem);
nsAString_Finish(&tag_str); nsAString_Finish(&tag_str);
nsAString_Init(&tag_str, pW); nsAString_Init(&tag_str, pW);
nsIDOMDocument_CreateElement(nsdoc, &tag_str, &p_elem); nsIDOMDocument_CreateElement(This->doc->nsdoc, &tag_str, &p_elem);
nsAString_Finish(&tag_str); nsAString_Finish(&tag_str);
nsIDOMDocument_Release(nsdoc);
nsIDOMRange_ExtractContents(This->nsrange, &fragment); nsIDOMRange_ExtractContents(This->nsrange, &fragment);
nsIDOMElement_AppendChild(p_elem, (nsIDOMNode*)fragment, &tmp); nsIDOMElement_AppendChild(p_elem, (nsIDOMNode*)fragment, &tmp);
nsIDOMDocumentFragment_Release(fragment); nsIDOMDocumentFragment_Release(fragment);