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

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51452
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 4e34e7513d)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Francois Gouget 2021-07-20 14:02:23 +02:00 committed by Michael Stefaniuc
parent dffceba799
commit e4ea517b6c
2 changed files with 5 additions and 6 deletions

View File

@ -2153,14 +2153,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);

View File

@ -1668,8 +1668,8 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
(!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;