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