Commit bf2e66cc authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

oleaut32: The decimal point takes priority over the thousands separator.

parent c909e69f
......@@ -2313,17 +2313,14 @@ static void test_VarParseNumFromStrMisc(void)
SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONDECIMALSEP, L"~");
hres = wconvert_str(L",1", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_DECIMAL, &np, rgb, LOCALE_USER_DEFAULT, 0);
todo_wine EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL,NUMPRS_DECIMAL,2,0,-1);
todo_wine EXPECTRGB(0,1);
EXPECTRGB(1,FAILDIG);
EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL,NUMPRS_DECIMAL,2,0,-1);
EXPECT2(1,FAILDIG);
hres = wconvert_str(L"1,000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0);
todo_wine EXPECTFAIL;
EXPECTFAIL;
hres = wconvert_str(L"1,", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0);
if (broken(1)) /* FIXME Reenable once Wine is less broken */
EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_USE_ALL,NUMPRS_DECIMAL,2,0,0);
todo_wine ok(np.dwOutFlags == NUMPRS_DECIMAL, "Got dwOutFlags=%08x\n", np.dwOutFlags);
EXPECT2(1,FAILDIG);
/* But not for their monetary equivalents */
......
......@@ -1607,6 +1607,9 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla
return DISP_E_TYPEMISMATCH;
VARIANT_GetLocalisedNumberChars(&chars, lcid, dwFlags);
if (chars.cDigitSeparator == chars.cDecimalPoint)
/* The decimal point completely masks the digit separator */
chars.cDigitSeparator = 0;
/* Setting the thousands separator to a non-breaking space implies regular
* spaces are allowed too. But the converse is not true.
*/
......
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