Module: wine Branch: master Commit: 7e30161184ea9a629fd2f2530f0eb739ce431ea7 URL: https://source.winehq.org/git/wine.git/?a=commit;h=7e30161184ea9a629fd2f2530...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Jun 26 18:36:51 2020 +0200
mshtml: Use variant_to_nsstr in IHTMLIFrameElement2::put_width.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mshtml/htmlframe.c | 9 ++++----- dlls/mshtml/tests/dom.c | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 0c07f0c677..e451f03045 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -1278,15 +1278,14 @@ static HRESULT WINAPI HTMLIFrameElement2_put_width(IHTMLIFrameElement2 *iface, V HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface); nsAString nsstr; nsresult nsres; + HRESULT hres;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- if(V_VT(&v) != VT_BSTR) { - FIXME("Unsupported %s\n", debugstr_variant(&v)); - return E_NOTIMPL; - } + hres = variant_to_nsstr(&v, FALSE, &nsstr); + if(FAILED(hres)) + return hres;
- nsAString_InitDepend(&nsstr, V_BSTR(&v)); nsres = nsIDOMHTMLIFrameElement_SetWidth(This->framebase.nsiframe, &nsstr); nsAString_Finish(&nsstr); if(NS_FAILED(nsres)) { diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 5ef27ede89..7b19271ad4 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -8264,6 +8264,12 @@ static void test_iframe_elem(IHTMLElement *elem) test_iframe_width(elem, L"70%"); test_framebase_src(elem, L"about:blank");
+ V_VT(&v) = VT_I4; + V_I4(&v) = 110; + hres = IHTMLIFrameElement2_put_width(iframe2, v); + ok(hres == S_OK, "put_height failed: %08x\n", hres); + test_iframe_width(elem, L"110"); + str = SysAllocString(L"text/html"); V_VT(&errv) = VT_ERROR; disp = NULL;