Damjan Jovanovic : oleaut32: Fix double negative sign regression in VarFormat.

Alexandre Julliard julliard at winehq.org
Thu Sep 25 07:13:39 CDT 2008


Module: wine
Branch: master
Commit: 72faaf1273ea093cd2a8a2b4ff330ef2711a6254
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=72faaf1273ea093cd2a8a2b4ff330ef2711a6254

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Wed Sep 24 18:49:19 2008 +0200

oleaut32: Fix double negative sign regression in VarFormat.

---

 dlls/oleaut32/tests/varformat.c |    2 ++
 dlls/oleaut32/varformat.c       |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/tests/varformat.c b/dlls/oleaut32/tests/varformat.c
index 00551e7..12d65b6 100644
--- a/dlls/oleaut32/tests/varformat.c
+++ b/dlls/oleaut32/tests/varformat.c
@@ -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");
diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c
index 217fb10..79c3053 100644
--- a/dlls/oleaut32/varformat.c
+++ b/dlls/oleaut32/varformat.c
@@ -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;




More information about the wine-cvs mailing list