From 54ef871161d92ece58de2cadae91e2166e4999a2 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sun, 8 Jun 2008 21:33:27 +0200 Subject: [PATCH] shdocvw: Fixed DISPID_ONTOOLBAR test on IE7. --- dlls/shdocvw/tests/webbrowser.c | 26 +++++++++++++++----------- dlls/shdocvw/webbrowser.c | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/dlls/shdocvw/tests/webbrowser.c b/dlls/shdocvw/tests/webbrowser.c index 29890764cd0..da926007ba0 100644 --- a/dlls/shdocvw/tests/webbrowser.c +++ b/dlls/shdocvw/tests/webbrowser.c @@ -422,14 +422,18 @@ static HRESULT WINAPI WebBrowserEvents2_QueryInterface(IDispatch *iface, REFIID return E_NOINTERFACE; } -#define test_invoke_bool(p) _test_invoke_bool(__LINE__,p) -static void _test_invoke_bool(unsigned line, const DISPPARAMS *params) +#define test_invoke_bool(p,s) _test_invoke_bool(__LINE__,p,s) +static void _test_invoke_bool(unsigned line, const DISPPARAMS *params, BOOL strict) { ok_(__FILE__,line) (params->rgvarg != NULL, "rgvarg == NULL\n"); ok_(__FILE__,line) (params->cArgs == 1, "cArgs=%d, expected 1\n", params->cArgs); ok_(__FILE__,line) (V_VT(params->rgvarg) == VT_BOOL, "V_VT(arg)=%d\n", V_VT(params->rgvarg)); - ok_(__FILE__,line) (V_BOOL(params->rgvarg) == exvb, "V_VT(arg)=%x, expected %x\n", - V_BOOL(params->rgvarg), exvb); + if(strict) + ok_(__FILE__,line) (V_BOOL(params->rgvarg) == exvb, "V_VT(arg)=%x, expected %x\n", + V_BOOL(params->rgvarg), exvb); + else + ok_(__FILE__,line) (!V_BOOL(params->rgvarg) == !exvb, "V_VT(arg)=%x, expected %x\n", + V_BOOL(params->rgvarg), exvb); } static void test_OnBeforeNavigate(const VARIANT *disp, const VARIANT *url, const VARIANT *flags, @@ -598,37 +602,37 @@ static HRESULT WINAPI WebBrowserEvents2_Invoke(IDispatch *iface, DISPID dispIdMe case DISPID_ONMENUBAR: CHECK_EXPECT(Invoke_ONMENUBAR); - test_invoke_bool(pDispParams); + test_invoke_bool(pDispParams, TRUE); break; case DISPID_ONADDRESSBAR: CHECK_EXPECT(Invoke_ONADDRESSBAR); - test_invoke_bool(pDispParams); + test_invoke_bool(pDispParams, TRUE); break; case DISPID_ONSTATUSBAR: CHECK_EXPECT(Invoke_ONSTATUSBAR); - test_invoke_bool(pDispParams); + test_invoke_bool(pDispParams, TRUE); break; case DISPID_ONTOOLBAR: CHECK_EXPECT(Invoke_ONTOOLBAR); - test_invoke_bool(pDispParams); + test_invoke_bool(pDispParams, FALSE); break; case DISPID_ONFULLSCREEN: CHECK_EXPECT(Invoke_ONFULLSCREEN); - test_invoke_bool(pDispParams); + test_invoke_bool(pDispParams, TRUE); break; case DISPID_ONTHEATERMODE: CHECK_EXPECT(Invoke_ONTHEATERMODE); - test_invoke_bool(pDispParams); + test_invoke_bool(pDispParams, TRUE); break; case DISPID_WINDOWSETRESIZABLE: CHECK_EXPECT(Invoke_WINDOWSETRESIZABLE); - test_invoke_bool(pDispParams); + test_invoke_bool(pDispParams, TRUE); break; default: diff --git a/dlls/shdocvw/webbrowser.c b/dlls/shdocvw/webbrowser.c index 1d1ca3643cd..50c3b347dcf 100644 --- a/dlls/shdocvw/webbrowser.c +++ b/dlls/shdocvw/webbrowser.c @@ -627,7 +627,7 @@ static HRESULT WINAPI WebBrowser_put_ToolBar(IWebBrowser2 *iface, int Value) * inform the embedder about the tool bar change. */ V_VT(&arg) = VT_BOOL; - V_BOOL(&arg) = Value; + V_BOOL(&arg) = This->tool_bar; call_sink(This->doc_host.cps.wbe2, DISPID_ONTOOLBAR, &dispparams); return S_OK;