Jacek Caban : mshtml: Use create_nselem in IHTMLOptionFactory::create.

Alexandre Julliard julliard at winehq.org
Tue Oct 20 10:33:37 CDT 2009


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Oct 19 23:04:36 2009 +0200

mshtml: Use create_nselem in IHTMLOptionFactory::create.

---

 dlls/mshtml/htmloption.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/dlls/mshtml/htmloption.c b/dlls/mshtml/htmloption.c
index 877eef2..e034d9d 100644
--- a/dlls/mshtml/htmloption.c
+++ b/dlls/mshtml/htmloption.c
@@ -448,9 +448,7 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
         IHTMLOptionElement **optelem)
 {
     HTMLOptionElementFactory *This = HTMLOPTFACTORY_THIS(iface);
-    nsIDOMElement *nselem;
-    nsAString option_str;
-    nsresult nsres;
+    nsIDOMHTMLElement *nselem;
     HRESULT hres;
 
     static const PRUnichar optionW[] = {'O','P','T','I','O','N',0};
@@ -458,24 +456,20 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
     TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_variant(&text), debugstr_variant(&value),
           debugstr_variant(&defaultselected), debugstr_variant(&selected), optelem);
 
-    if(!This->window || !This->window->doc || !This->window->doc->basedoc.nsdoc) {
-        WARN("NULL nsdoc\n");
+    if(!This->window || !This->window->doc) {
+        WARN("NULL doc\n");
         return E_UNEXPECTED;
     }
 
     *optelem = NULL;
 
-    nsAString_Init(&option_str, optionW);
-    nsres = nsIDOMHTMLDocument_CreateElement(This->window->doc->basedoc.nsdoc, &option_str, &nselem);
-    nsAString_Finish(&option_str);
-    if(NS_FAILED(nsres)) {
-        ERR("CreateElement failed: %08x\n", nsres);
-        return E_FAIL;
-    }
+    hres = create_nselem(This->window->doc, optionW, &nselem);
+    if(FAILED(hres))
+        return hres;
 
     hres = IHTMLDOMNode_QueryInterface(HTMLDOMNODE(get_node(This->window->doc, (nsIDOMNode*)nselem, TRUE)),
             &IID_IHTMLOptionElement, (void**)optelem);
-    nsIDOMElement_Release(nselem);
+    nsIDOMHTMLElement_Release(nselem);
 
     if(V_VT(&text) == VT_BSTR)
         IHTMLOptionElement_put_text(*optelem, V_BSTR(&text));




More information about the wine-cvs mailing list