Commit 8162797a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use stored nsdoc in IHTMLOptionElementFactory::create.

parent c3ea7272
...@@ -448,7 +448,6 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory ...@@ -448,7 +448,6 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
IHTMLOptionElement **optelem) IHTMLOptionElement **optelem)
{ {
HTMLOptionElementFactory *This = HTMLOPTFACTORY_THIS(iface); HTMLOptionElementFactory *This = HTMLOPTFACTORY_THIS(iface);
nsIDOMDocument *nsdoc;
nsIDOMElement *nselem; nsIDOMElement *nselem;
nsAString option_str; nsAString option_str;
nsresult nsres; nsresult nsres;
...@@ -456,21 +455,18 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory ...@@ -456,21 +455,18 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
static const PRUnichar optionW[] = {'O','P','T','I','O','N',0}; static const PRUnichar optionW[] = {'O','P','T','I','O','N',0};
TRACE("(%p)->(v v v v %p)\n", This, optelem); TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_variant(&text), debugstr_variant(&value),
debugstr_variant(&defaultselected), debugstr_variant(&selected), optelem);
*optelem = NULL; if(!This->doc->nsdoc) {
if(!This->doc->nscontainer) WARN("NULL nsdoc\n");
return E_FAIL; return E_UNEXPECTED;
nsres = nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc);
if(NS_FAILED(nsres)) {
ERR("GetDocument failed: %08x\n", nsres);
return E_FAIL;
} }
*optelem = NULL;
nsAString_Init(&option_str, optionW); nsAString_Init(&option_str, optionW);
nsres = nsIDOMDocument_CreateElement(nsdoc, &option_str, &nselem); nsres = nsIDOMHTMLDocument_CreateElement(This->doc->nsdoc, &option_str, &nselem);
nsIDOMDocument_Release(nsdoc);
nsAString_Finish(&option_str); nsAString_Finish(&option_str);
if(NS_FAILED(nsres)) { if(NS_FAILED(nsres)) {
ERR("CreateElement failed: %08x\n", nsres); ERR("CreateElement 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