Commit eebc40f2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLSelectElement::multiple property implementation.

parent dee50ab8
...@@ -156,15 +156,28 @@ static HRESULT WINAPI HTMLSelectElement_get_size(IHTMLSelectElement *iface, LONG ...@@ -156,15 +156,28 @@ static HRESULT WINAPI HTMLSelectElement_get_size(IHTMLSelectElement *iface, LONG
static HRESULT WINAPI HTMLSelectElement_put_multiple(IHTMLSelectElement *iface, VARIANT_BOOL v) static HRESULT WINAPI HTMLSelectElement_put_multiple(IHTMLSelectElement *iface, VARIANT_BOOL v)
{ {
HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface); HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
FIXME("(%p)->(%x)\n", This, v); nsresult nsres;
return E_NOTIMPL;
TRACE("(%p)->(%x)\n", This, v);
nsres = nsIDOMHTMLSelectElement_SetMultiple(This->nsselect, !!v);
assert(nsres == NS_OK);
return S_OK;
} }
static HRESULT WINAPI HTMLSelectElement_get_multiple(IHTMLSelectElement *iface, VARIANT_BOOL *p) static HRESULT WINAPI HTMLSelectElement_get_multiple(IHTMLSelectElement *iface, VARIANT_BOOL *p)
{ {
HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface); HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
FIXME("(%p)->(%p)\n", This, p); cpp_bool val;
return E_NOTIMPL; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMHTMLSelectElement_GetMultiple(This->nsselect, &val);
assert(nsres == NS_OK);
*p = val ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
} }
static HRESULT WINAPI HTMLSelectElement_put_name(IHTMLSelectElement *iface, BSTR v) static HRESULT WINAPI HTMLSelectElement_put_name(IHTMLSelectElement *iface, BSTR v)
......
...@@ -1943,6 +1943,28 @@ static void _test_select_type(unsigned line, IHTMLSelectElement *select, const c ...@@ -1943,6 +1943,28 @@ static void _test_select_type(unsigned line, IHTMLSelectElement *select, const c
SysFreeString(type); SysFreeString(type);
} }
#define test_select_multiple(s,t) _test_select_multiple(__LINE__,s,t)
static void _test_select_multiple(unsigned line, IHTMLSelectElement *select, VARIANT_BOOL exmultiple)
{
VARIANT_BOOL b = 100;
HRESULT hres;
hres = IHTMLSelectElement_get_multiple(select, &b);
ok_(__FILE__,line) (hres == S_OK, "get_multiple failed: %08x\n", hres);
ok_(__FILE__,line) (b == exmultiple, "multiple=%x, expected %x\n", b, exmultiple);
}
#define test_select_set_multiple(s,v) _test_select_set_multiple(__LINE__,s,v)
static void _test_select_set_multiple(unsigned line, IHTMLSelectElement *select, VARIANT_BOOL val)
{
HRESULT hres;
hres = IHTMLSelectElement_put_multiple(select, val);
ok_(__FILE__,line) (hres == S_OK, "put_multiple failed: %08x\n", hres);
_test_select_multiple(line, select, val);
}
#define test_range_text(r,t) _test_range_text(__LINE__,r,t) #define test_range_text(r,t) _test_range_text(__LINE__,r,t)
static void _test_range_text(unsigned line, IHTMLTxtRange *range, const char *extext) static void _test_range_text(unsigned line, IHTMLTxtRange *range, const char *extext)
{ {
...@@ -4212,6 +4234,9 @@ static void test_select_elem(IHTMLSelectElement *select) ...@@ -4212,6 +4234,9 @@ static void test_select_elem(IHTMLSelectElement *select)
ok(iface_cmp((IUnknown*)disp, (IUnknown*)disp2), "disp != disp2\n"); ok(iface_cmp((IUnknown*)disp, (IUnknown*)disp2), "disp != disp2\n");
IDispatch_Release(disp2); IDispatch_Release(disp2);
IDispatch_Release(disp); IDispatch_Release(disp);
test_select_multiple(select, VARIANT_FALSE);
test_select_set_multiple(select, VARIANT_TRUE);
} }
static void test_form_item(IHTMLElement *elem) static void test_form_item(IHTMLElement *elem)
......
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