oleaut32: VarParseNumFromStr() does not allow leading thousands separators.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit de70f7289e
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
parent
806b738a11
commit
014c114a28
|
@ -1605,7 +1605,7 @@ static void test_VarParseNumFromStrEn(void)
|
||||||
|
|
||||||
/* With flag, but leading thousands separators are not allowed */
|
/* With flag, but leading thousands separators are not allowed */
|
||||||
CONVERT(",1,000", NUMPRS_THOUSANDS);
|
CONVERT(",1,000", NUMPRS_THOUSANDS);
|
||||||
todo_wine EXPECTFAIL;
|
EXPECTFAIL;
|
||||||
|
|
||||||
/* With flag, thousands separator not needed but still reported */
|
/* With flag, thousands separator not needed but still reported */
|
||||||
CONVERT("1,", NUMPRS_THOUSANDS);
|
CONVERT("1,", NUMPRS_THOUSANDS);
|
||||||
|
@ -1982,7 +1982,7 @@ static void test_VarParseNumFromStrFr(void)
|
||||||
|
|
||||||
/* With flag, but leading thousands separators are not allowed */
|
/* With flag, but leading thousands separators are not allowed */
|
||||||
CONVERT(" 1 000", NUMPRS_THOUSANDS);
|
CONVERT(" 1 000", NUMPRS_THOUSANDS);
|
||||||
todo_wine EXPECTFAIL;
|
EXPECTFAIL;
|
||||||
|
|
||||||
/* With flag, thousands separator not needed but still reported */
|
/* With flag, thousands separator not needed but still reported */
|
||||||
CONVERT("1 ", NUMPRS_THOUSANDS|NUMPRS_USE_ALL);
|
CONVERT("1 ", NUMPRS_THOUSANDS|NUMPRS_USE_ALL);
|
||||||
|
|
|
@ -1651,6 +1651,12 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
|
||||||
lpszStr++;
|
lpszStr++;
|
||||||
} while (iswspace(*lpszStr));
|
} while (iswspace(*lpszStr));
|
||||||
}
|
}
|
||||||
|
else if (pNumprs->dwInFlags & NUMPRS_THOUSANDS &&
|
||||||
|
((chars.cDigitSeparator && *lpszStr == chars.cDigitSeparator) ||
|
||||||
|
(cDigitSeparator2 && *lpszStr == cDigitSeparator2)))
|
||||||
|
{
|
||||||
|
return DISP_E_TYPEMISMATCH; /* Not allowed before the first digit */
|
||||||
|
}
|
||||||
else if (pNumprs->dwInFlags & NUMPRS_LEADING_PLUS &&
|
else if (pNumprs->dwInFlags & NUMPRS_LEADING_PLUS &&
|
||||||
*lpszStr == chars.cPositiveSymbol &&
|
*lpszStr == chars.cPositiveSymbol &&
|
||||||
!(pNumprs->dwOutFlags & NUMPRS_LEADING_PLUS))
|
!(pNumprs->dwOutFlags & NUMPRS_LEADING_PLUS))
|
||||||
|
|
Loading…
Reference in New Issue