oleaut32: Fix double negative sign regression in VarFormat.

This commit is contained in:
Damjan Jovanovic 2008-09-24 18:49:19 +02:00 committed by Alexandre Julliard
parent 8c20124fc4
commit 72faaf1273
2 changed files with 4 additions and 2 deletions

View File

@ -328,6 +328,8 @@ static void test_VarFormat(void)
VARFMT(VT_I4,V_I4,1,"0,000,000,000",S_OK,"0,000,000,001");
VARFMT(VT_I4,V_I4,123456789,"#,#.#",S_OK,"123,456,789.");
VARFMT(VT_I4,V_I4,123456789,"###, ###, ###",S_OK,"123, 456, 789");
VARFMT(VT_I4,V_I4,1,"#;-#",S_OK,"1");
VARFMT(VT_I4,V_I4,-1,"#;-#",S_OK,"-1");
VARFMT(VT_R8,V_R8,1.23456789,"0#.0#0#0#0#0",S_OK,"01.234567890");
VARFMT(VT_R8,V_R8,1.2,"0#.0#0#0#0#0",S_OK,"01.200000000");
VARFMT(VT_R8,V_R8,9.87654321,"#0.#0#0#0#0#",S_OK,"9.87654321");

View File

@ -1391,7 +1391,7 @@ VARIANT_FormatNumber_Bool:
break;
case FMT_NUM_DECIMAL:
if ((np.dwOutFlags & NUMPRS_NEG) && !(dwState & NUM_WROTE_SIGN))
if ((np.dwOutFlags & NUMPRS_NEG) && !(dwState & NUM_WROTE_SIGN) && !header->starts[1])
{
/* last chance for a negative sign in the .# case */
TRACE("write negative sign\n");
@ -1476,7 +1476,7 @@ VARIANT_FormatNumber_Bool:
{
int count, count_max, position;
if ((np.dwOutFlags & NUMPRS_NEG) && !(dwState & NUM_WROTE_SIGN))
if ((np.dwOutFlags & NUMPRS_NEG) && !(dwState & NUM_WROTE_SIGN) && !header->starts[1])
{
TRACE("write negative sign\n");
localeValue = LOCALE_SNEGATIVESIGN;