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

mshtml: Use variant_bool helper where appropriate.

parent bbffabf1
......@@ -971,7 +971,7 @@ static HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvi
case VT_BOOL:
if(V_VT(src) == VT_BSTR) {
V_VT(dst) = VT_BOOL;
V_BOOL(dst) = V_BSTR(src) && *V_BSTR(src) ? VARIANT_TRUE : VARIANT_FALSE;
V_BOOL(dst) = variant_bool(V_BSTR(src) && *V_BSTR(src));
return S_OK;
}
break;
......
......@@ -333,7 +333,7 @@ static HRESULT WINAPI HTMLDOMAttribute2_get_expando(IHTMLDOMAttribute2 *iface, V
TRACE("(%p)->(%p)\n", This, p);
*p = !This->elem || get_dispid_type(This->dispid) == DISPEXPROP_BUILTIN ? VARIANT_FALSE : VARIANT_TRUE;
*p = variant_bool(This->elem && get_dispid_type(This->dispid) != DISPEXPROP_BUILTIN);
return S_OK;
}
......
......@@ -2606,7 +2606,7 @@ static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL
nsres = nsIDOMHTMLDocument_HasFocus(This->doc_node->nsdoc, &has_focus);
assert(nsres == NS_OK);
*pfFocus = has_focus ? VARIANT_TRUE : VARIANT_FALSE;
*pfFocus = variant_bool(has_focus);
return S_OK;
}
......
......@@ -1267,7 +1267,7 @@ static HRESULT WINAPI HTMLElement_contains(IHTMLElement *iface, IHTMLElement *pC
assert(nsres == NS_OK);
}
*pfResult = result ? VARIANT_TRUE : VARIANT_FALSE;
*pfResult = variant_bool(result);
return S_OK;
}
......@@ -1777,8 +1777,7 @@ static HRESULT WINAPI HTMLElement_get_isTextEdit(IHTMLElement *iface, VARIANT_BO
TRACE("(%p)->(%p)\n", This, p);
*p = This->node.vtbl->is_text_edit && This->node.vtbl->is_text_edit(&This->node)
? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(This->node.vtbl->is_text_edit && This->node.vtbl->is_text_edit(&This->node));
return S_OK;
}
......
......@@ -421,7 +421,7 @@ static HRESULT WINAPI HTMLEventObj_get_altKey(IHTMLEventObj *iface, VARIANT_BOOL
}
}
*p = ret ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(ret);
return S_OK;
}
......@@ -451,7 +451,7 @@ static HRESULT WINAPI HTMLEventObj_get_ctrlKey(IHTMLEventObj *iface, VARIANT_BOO
}
}
*p = ret ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(ret);
return S_OK;
}
......@@ -481,7 +481,7 @@ static HRESULT WINAPI HTMLEventObj_get_shiftKey(IHTMLEventObj *iface, VARIANT_BO
}
}
*p = ret ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(ret);
return S_OK;
}
......@@ -529,7 +529,7 @@ static HRESULT WINAPI HTMLEventObj_get_cancelBubble(IHTMLEventObj *iface, VARIAN
TRACE("(%p)->(%p)\n", This, p);
*p = This->event && This->event->stop_propagation ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(This->event && This->event->stop_propagation);
return S_OK;
}
......
......@@ -131,7 +131,8 @@ static HRESULT WINAPI HTMLImgElement_get_isMap(IHTMLImgElement *iface, VARIANT_B
ERR("Get IsMap failed: %08x\n", nsres);
return E_FAIL;
}
*p = b ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(b);
return S_OK;
}
......@@ -391,7 +392,7 @@ static HRESULT WINAPI HTMLImgElement_get_complete(IHTMLImgElement *iface, VARIAN
return E_FAIL;
}
*p = complete ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(complete);
return S_OK;
}
......
......@@ -302,7 +302,7 @@ static HRESULT WINAPI HTMLLinkElement_get_disabled(IHTMLLinkElement *iface, VARI
if(NS_FAILED(nsres))
return E_FAIL;
*p = ret ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(ret);
return S_OK;
}
......
......@@ -610,7 +610,7 @@ static HRESULT WINAPI HTMLDOMNode_hasChildNodes(IHTMLDOMNode *iface, VARIANT_BOO
if(NS_FAILED(nsres))
ERR("HasChildNodes failed: %08x\n", nsres);
*fChildren = has_child ? VARIANT_TRUE : VARIANT_FALSE;
*fChildren = variant_bool(has_child);
return S_OK;
}
......
......@@ -129,7 +129,7 @@ static HRESULT WINAPI HTMLOptionElement_get_selected(IHTMLOptionElement *iface,
return E_FAIL;
}
*p = selected ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(selected);
return S_OK;
}
......@@ -211,7 +211,7 @@ static HRESULT WINAPI HTMLOptionElement_get_defaultSelected(IHTMLOptionElement *
return E_FAIL;
}
*p = val ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(val);
return S_OK;
}
......
......@@ -258,9 +258,7 @@ static HRESULT WINAPI HTMLScriptElement_get_defer(IHTMLScriptElement *iface, VAR
ERR("GetSrc failed: %08x\n", nsres);
}
*p = defer ? VARIANT_TRUE : VARIANT_FALSE;
TRACE("*p = %d\n", *p);
*p = variant_bool(defer);
return S_OK;
}
......
......@@ -198,7 +198,7 @@ static HRESULT WINAPI HTMLSelectElement_get_multiple(IHTMLSelectElement *iface,
nsres = nsIDOMHTMLSelectElement_GetMultiple(This->nsselect, &val);
assert(nsres == NS_OK);
*p = val ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(val);
return S_OK;
}
......@@ -364,7 +364,7 @@ static HRESULT WINAPI HTMLSelectElement_get_disabled(IHTMLSelectElement *iface,
return E_FAIL;
}
*p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(disabled);
return S_OK;
}
......
......@@ -628,7 +628,7 @@ static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR ex
get_nsstyle_attr_nsval(This->nsstyle, sid, &str_value);
nsAString_GetData(&str_value, &value);
*p = strcmpW(value, exval) ? VARIANT_FALSE : VARIANT_TRUE;
*p = variant_bool(!strcmpW(value, exval));
nsAString_Finish(&str_value);
TRACE("%s -> %x\n", debugstr_w(style_tbl[sid].name), *p);
......@@ -2927,7 +2927,7 @@ static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttri
/* filter property is a special case */
if(style_entry->dispid == DISPID_IHTMLSTYLE_FILTER) {
*pfSuccess = This->elem->filter && *This->elem->filter ? VARIANT_TRUE : VARIANT_FALSE;
*pfSuccess = variant_bool(This->elem->filter && *This->elem->filter);
heap_free(This->elem->filter);
This->elem->filter = NULL;
update_filter(This);
......@@ -2940,7 +2940,7 @@ static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttri
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *ret;
nsAString_GetData(&ret_str, &ret);
*pfSuccess = *ret ? VARIANT_TRUE : VARIANT_FALSE;
*pfSuccess = variant_bool(*ret);
}else {
ERR("RemoveProperty failed: %08x\n", nsres);
}
......
......@@ -318,7 +318,7 @@ static HRESULT WINAPI HTMLTextAreaElement_get_readOnly(IHTMLTextAreaElement *ifa
return E_FAIL;
}
*p = b ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(b);
return S_OK;
}
......
......@@ -862,7 +862,7 @@ static BOOL notify_webbrowser_close(HTMLOuterWindow *window, HTMLDocumentObj *do
V_VT(args) = VT_BYREF|VT_BOOL;
V_BOOLREF(args) = &cancel;
V_VT(args+1) = VT_BOOL;
V_BOOL(args+1) = window->parent ? VARIANT_TRUE : VARIANT_FALSE;
V_BOOL(args+1) = variant_bool(window->parent != NULL);
hres = IDispatch_Invoke(disp, DISPID_WINDOWCLOSING, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL);
IDispatch_Release(disp);
if(FAILED(hres))
......
......@@ -610,7 +610,7 @@ static HRESULT WINAPI BindCallbackRedirect_Redirect(IBindCallbackRedirect *iface
SysFreeString(frame_name);
}
*vbCancel = cancel ? VARIANT_TRUE : VARIANT_FALSE;
*vbCancel = variant_bool(cancel);
return hres;
}
......
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