vbscript: Use current locale in to_string.
This commit is contained in:
parent
2be12eacaf
commit
6bef4da592
|
@ -124,26 +124,16 @@ static HRESULT to_int(VARIANT *v, int *ret)
|
||||||
|
|
||||||
static HRESULT to_string(VARIANT *v, BSTR *ret)
|
static HRESULT to_string(VARIANT *v, BSTR *ret)
|
||||||
{
|
{
|
||||||
static const WCHAR trueW[] = {'T','r','u','e',0};
|
|
||||||
static const WCHAR falseW[] = {'F','a','l','s','e',0};
|
|
||||||
|
|
||||||
switch(V_VT(v)) {
|
|
||||||
case VT_BOOL:
|
|
||||||
*ret = SysAllocString(V_BOOL(v) ? trueW : falseW);
|
|
||||||
return *ret ? S_OK : E_OUTOFMEMORY;
|
|
||||||
default: {
|
|
||||||
VARIANT dst;
|
VARIANT dst;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
V_VT(&dst) = VT_EMPTY;
|
V_VT(&dst) = VT_EMPTY;
|
||||||
hres = VariantChangeTypeEx(&dst, v, MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT), 0, VT_BSTR);
|
hres = VariantChangeType(&dst, v, VARIANT_LOCALBOOL, VT_BSTR);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return hres;
|
return hres;
|
||||||
|
|
||||||
*ret = V_BSTR(&dst);
|
*ret = V_BSTR(&dst);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid)
|
static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid)
|
||||||
|
|
Loading…
Reference in New Issue