mshtml: Added IHTMLSelectElement::multiple property implementation.

This commit is contained in:
Jacek Caban 2013-11-14 16:17:02 +01:00 committed by Alexandre Julliard
parent dee50ab8b4
commit eebc40f2b3
2 changed files with 42 additions and 4 deletions

View File

@ -156,15 +156,28 @@ static HRESULT WINAPI HTMLSelectElement_get_size(IHTMLSelectElement *iface, LONG
static HRESULT WINAPI HTMLSelectElement_put_multiple(IHTMLSelectElement *iface, VARIANT_BOOL v)
{
HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
nsresult nsres;
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)
{
HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
cpp_bool val;
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)

View File

@ -1943,6 +1943,28 @@ static void _test_select_type(unsigned line, IHTMLSelectElement *select, const c
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)
static void _test_range_text(unsigned line, IHTMLTxtRange *range, const char *extext)
{
@ -4212,6 +4234,9 @@ static void test_select_elem(IHTMLSelectElement *select)
ok(iface_cmp((IUnknown*)disp, (IUnknown*)disp2), "disp != disp2\n");
IDispatch_Release(disp2);
IDispatch_Release(disp);
test_select_multiple(select, VARIANT_FALSE);
test_select_set_multiple(select, VARIANT_TRUE);
}
static void test_form_item(IHTMLElement *elem)