Commit 4e34e751 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

oleaut32: Fix VarParseNumFromStr()'s support for two-character currencies.

parent 75cbc88e
......@@ -2154,14 +2154,13 @@ static void test_VarParseNumFromStrMisc(void)
/* 2 Polish zloty */
lcid = MAKELCID(MAKELANGID(LANG_POLISH,SUBLANG_POLISH_POLAND),SORT_DEFAULT);
WCONVERT(L"z\x142\x32", NUMPRS_CURRENCY|NUMPRS_USE_ALL);
todo_wine EXPECT(1,NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_CURRENCY,3,0,0);
todo_wine EXPECT2(2,FAILDIG);
EXPECT(1,NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_CURRENCY,3,0,0);
EXPECT2(2,FAILDIG);
/* Multi-character currencies can be repeated too "zl2zlzl" */
WCONVERT(L"z\x142\x32z\x142z\x142", NUMPRS_CURRENCY|NUMPRS_USE_ALL);
todo_wine EXPECT(1,NUMPRS_CURRENCY|NUMPRS_USE_ALL,NUMPRS_CURRENCY,7,0,0);
todo_wine EXPECTRGB(0,2);
EXPECTRGB(1,FAILDIG);
EXPECT2(2,FAILDIG);
lcid = MAKELCID(MAKELANGID(LANG_FRENCH,SUBLANG_FRENCH_SWISS),SORT_DEFAULT);
WCONVERT(L"3CHF", NUMPRS_CURRENCY|NUMPRS_USE_ALL);
......
......@@ -1669,8 +1669,8 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla
(!chars.cCurrencyLocal2 || lpszStr[1] == chars.cCurrencyLocal2))
{
pNumprs->dwOutFlags |= NUMPRS_CURRENCY;
cchUsed++;
lpszStr++;
cchUsed += chars.cCurrencyLocal2 ? 2 : 1;
lpszStr += chars.cCurrencyLocal2 ? 2 : 1;
/* Only accept currency characters */
chars.cDecimalPoint = chars.cCurrencyDecimalPoint;
chars.cDigitSeparator = chars.cCurrencyDigitSeparator;
......
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