Francois Gouget : oleaut32: The decimal point takes priority over the thousands separator.

Alexandre Julliard julliard at winehq.org
Fri Aug 6 16:10:39 CDT 2021


Module: wine
Branch: master
Commit: bf2e66cc3f5320c3901a58338d2c53862e43cee7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=bf2e66cc3f5320c3901a58338d2c53862e43cee7

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Fri Aug  6 12:53:03 2021 +0200

oleaut32: The decimal point takes priority over the thousands separator.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/oleaut32/tests/vartest.c | 9 +++------
 dlls/oleaut32/variant.c       | 3 +++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c
index 89859988f1f..ecc8e8b0f11 100644
--- a/dlls/oleaut32/tests/vartest.c
+++ b/dlls/oleaut32/tests/vartest.c
@@ -2313,17 +2313,14 @@ static void test_VarParseNumFromStrMisc(void)
       SetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONDECIMALSEP, L"~");
 
       hres = wconvert_str(L",1", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_DECIMAL, &np, rgb, LOCALE_USER_DEFAULT, 0);
-      todo_wine EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL,NUMPRS_DECIMAL,2,0,-1);
-      todo_wine EXPECTRGB(0,1);
-      EXPECTRGB(1,FAILDIG);
+      EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL,NUMPRS_DECIMAL,2,0,-1);
+      EXPECT2(1,FAILDIG);
 
       hres = wconvert_str(L"1,000", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0);
-      todo_wine EXPECTFAIL;
+      EXPECTFAIL;
 
       hres = wconvert_str(L"1,", ARRAY_SIZE(rgb), NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_USE_ALL, &np, rgb, LOCALE_USER_DEFAULT, 0);
-      if (broken(1)) /* FIXME Reenable once Wine is less broken */
       EXPECT(1,NUMPRS_THOUSANDS|NUMPRS_DECIMAL|NUMPRS_USE_ALL,NUMPRS_DECIMAL,2,0,0);
-      todo_wine ok(np.dwOutFlags == NUMPRS_DECIMAL, "Got dwOutFlags=%08x\n", np.dwOutFlags);
       EXPECT2(1,FAILDIG);
 
       /* But not for their monetary equivalents */
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index 14ba63b9b2e..264b9f6594b 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -1607,6 +1607,9 @@ HRESULT WINAPI VarParseNumFromStr(const OLECHAR *lpszStr, LCID lcid, ULONG dwFla
     return DISP_E_TYPEMISMATCH;
 
   VARIANT_GetLocalisedNumberChars(&chars, lcid, dwFlags);
+  if (chars.cDigitSeparator == chars.cDecimalPoint)
+    /* The decimal point completely masks the digit separator */
+    chars.cDigitSeparator = 0;
   /* Setting the thousands separator to a non-breaking space implies regular
    * spaces are allowed too. But the converse is not true.
    */




More information about the wine-cvs mailing list