Alexandre Julliard : oleaut32: Use the locale leading zero flag instead of hardcoding it.

Alexandre Julliard julliard at winehq.org
Tue May 3 15:39:23 CDT 2022


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue May  3 10:33:21 2022 +0200

oleaut32: Use the locale leading zero flag instead of hardcoding it.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/oleaut32/vartype.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c
index 3850fec7066..bc8bd0d2197 100644
--- a/dlls/oleaut32/vartype.c
+++ b/dlls/oleaut32/vartype.c
@@ -6512,12 +6512,14 @@ static BSTR VARIANT_BstrReplaceDecimal(const WCHAR * buff, LCID lcid, ULONG dwFl
     NUMBERFMTW minFormat;
 
     minFormat.NumDigits = 0;
-    minFormat.LeadingZero = 0;
     minFormat.Grouping = 0;
     minFormat.lpDecimalSep = lpDecimalSep;
     minFormat.lpThousandSep = empty;
     minFormat.NegativeOrder = 1; /* NLS_NEG_LEFT */
 
+    GetLocaleInfoW(lcid, LOCALE_ILZERO | LOCALE_RETURN_NUMBER | (dwFlags & LOCALE_NOUSEROVERRIDE),
+                   (WCHAR *)&minFormat.LeadingZero, sizeof(DWORD)/sizeof(WCHAR) );
+
     /* count number of decimal digits in string */
     p = wcschr( buff, '.' );
     if (p) minFormat.NumDigits = lstrlenW(p + 1);




More information about the wine-cvs mailing list