Zhenbo Li : mshtml: Fix error handler in IHTMLSelectElement::remove().

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 7 10:57:43 CDT 2015


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

Author: Zhenbo Li <litimetal at gmail.com>
Date:   Fri Aug  7 18:12:58 2015 +0800

mshtml: Fix error handler in IHTMLSelectElement::remove().

---

 dlls/mshtml/htmlselect.c | 3 +++
 dlls/mshtml/tests/dom.c  | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c
index 152d855..e55d7ea 100644
--- a/dlls/mshtml/htmlselect.c
+++ b/dlls/mshtml/htmlselect.c
@@ -432,6 +432,9 @@ static HRESULT WINAPI HTMLSelectElement_remove(IHTMLSelectElement *iface, LONG i
     HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
     nsresult nsres;
     TRACE("(%p)->(%d)\n", This, index);
+    if(index < 0)
+        return E_INVALIDARG;
+
     nsres = nsIDOMHTMLSelectElement_select_Remove(This->nsselect, index);
     if(NS_FAILED(nsres)) {
         ERR("Remove failed: %08x\n", nsres);
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 02eeb78..7088c52 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2872,7 +2872,6 @@ static void test_select_remove(IHTMLSelectElement *select)
     test_select_length(select, 2);
 
     hres = IHTMLSelectElement_remove(select, -1);
-    todo_wine
     ok(hres == E_INVALIDARG, "remove failed: %08x, expected E_INVALIDARG\n", hres);
     test_select_length(select, 2);
 




More information about the wine-cvs mailing list