mshtml: Introduce variant_bool helper.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-11-02 16:47:45 +01:00 committed by Alexandre Julliard
parent 5996398360
commit 0bff85cd44
2 changed files with 11 additions and 5 deletions

View File

@ -275,7 +275,7 @@ static HRESULT WINAPI HTMLInputElement_get_disabled(IHTMLInputElement *iface, VA
nsIDOMHTMLInputElement_GetDisabled(This->nsinput, &disabled);
*p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(disabled);
return S_OK;
}
@ -474,7 +474,8 @@ static HRESULT WINAPI HTMLInputElement_get_readOnly(IHTMLInputElement *iface, VA
ERR("Get ReadOnly Failed: %08x\n", nsres);
return E_FAIL;
}
*p = b ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(b);
return S_OK;
}
@ -529,7 +530,7 @@ static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *ifa
return E_FAIL;
}
*p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(default_checked);
return S_OK;
}
@ -563,7 +564,7 @@ static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VAR
return E_FAIL;
}
*p = checked ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(checked);
TRACE("checked=%x\n", *p);
return S_OK;
}
@ -1891,7 +1892,7 @@ static HRESULT WINAPI HTMLButtonElement_get_disabled(IHTMLButtonElement *iface,
return E_FAIL;
}
*p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
*p = variant_bool(disabled);
return S_OK;
}

View File

@ -1333,6 +1333,11 @@ static inline void windowref_release(windowref_t *ref)
heap_free(ref);
}
static inline VARIANT_BOOL variant_bool(BOOL b)
{
return b ? VARIANT_TRUE : VARIANT_FALSE;
}
UINT cp_from_charset_string(BSTR) DECLSPEC_HIDDEN;
BSTR charset_string_from_cp(UINT) DECLSPEC_HIDDEN;
HDC get_display_dc(void) DECLSPEC_HIDDEN;