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

oleaut32: VarParseNumFromStr() does not allow leading thousands separators.

parent c50dff86
......@@ -1606,7 +1606,7 @@ static void test_VarParseNumFromStrEn(void)
/* With flag, but leading thousands separators are not allowed */
CONVERT(",1,000", NUMPRS_THOUSANDS);
todo_wine EXPECTFAIL;
EXPECTFAIL;
/* With flag, thousands separator not needed but still reported */
CONVERT("1,", NUMPRS_THOUSANDS);
......@@ -1983,7 +1983,7 @@ static void test_VarParseNumFromStrFr(void)
/* With flag, but leading thousands separators are not allowed */
CONVERT(" 1 000", NUMPRS_THOUSANDS);
todo_wine EXPECTFAIL;
EXPECTFAIL;
/* With flag, thousands separator not needed but still reported */
CONVERT("1 ", NUMPRS_THOUSANDS|NUMPRS_USE_ALL);
......
......@@ -1652,6 +1652,12 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla
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 &&
*lpszStr == chars.cPositiveSymbol &&
!(pNumprs->dwOutFlags & NUMPRS_LEADING_PLUS))
......
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