Alexandre Julliard : kernelbase: Reimplement LOCALE_*PERCENT in GetLocaleInfoW/Ex using the locale.nls data.

Alexandre Julliard julliard at winehq.org
Tue Mar 29 15:09:52 CDT 2022


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Mar 29 08:36:30 2022 +0200

kernelbase: Reimplement LOCALE_*PERCENT in GetLocaleInfoW/Ex using the locale.nls data.

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

---

 dlls/kernelbase/locale.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
index 3eb598be505..e3960c1e74e 100644
--- a/dlls/kernelbase/locale.c
+++ b/dlls/kernelbase/locale.c
@@ -900,6 +900,7 @@ static int locale_return_strarray( DWORD pos, WORD idx, LCTYPE type, WCHAR *buff
 static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE type,
                             WCHAR *buffer, int len )
 {
+    static const WCHAR spermille[] = { 0x2030, 0 };  /* this one seems hardcoded */
     UINT val;
 
     if (locale != user_locale) type |= LOCALE_NOUSEROVERRIDE;
@@ -1185,16 +1186,16 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
         return locale_return_string( locale->snativedisplayname, type, buffer, len );
 
     case LOCALE_INEGATIVEPERCENT:
-        return -1;
+        return locale_return_number( locale->inegativepercent, type, buffer, len );
 
     case LOCALE_IPOSITIVEPERCENT:
-        return -1;
+        return locale_return_number( locale->ipositivepercent, type, buffer, len );
 
     case LOCALE_SPERCENT:
-        return -1;
+        return locale_return_string( locale->spercent, type, buffer, len );
 
     case LOCALE_SPERMILLE:
-        return -1;
+        return locale_return_data( spermille, ARRAY_SIZE(spermille), type, buffer, len );
 
     case LOCALE_SMONTHDAY:
         return -1;




More information about the wine-cvs mailing list