Fix for locale regression test failures ...

Paul Millar paulm at astro.gla.ac.uk
Wed Jun 12 18:20:17 CDT 2002


Hi,

The problem _seems_ to be the same problem with ole/old2nls.c in two 
places. In GetNumberFormatA, it was (line 3091 onward):

    if (lpFormat != NULL)
        [...]
    else
    {
        if (dwflags & LOCALE_NOUSEROVERRIDE)
            used_operation = USE_LOCALEINFO;
        else
            used_operation = USE_SYSTEMDEFAULT;
    }

with an equivalent test in GetCurrencyFormatA (see line 3331 onward).  
Both these tests look wrong as the logic is screwed up (not setting
LOCALE_NOUSEROVERRIDE => use system defaults).

After sullying my hands with MSDN, I found the following references:
  http://msdn.microsoft.com/library/en-us/intl/nls_0rec.asp
and
  http://msdn.microsoft.com/library/en-us/intl/nls_8a0k.asp
for GetCurrencyFormat and GetNumberFormat respectively. Both have a 
passage like:
> If lpFormat is NULL, you can specify LOCALE_NOUSEROVERRIDE to format the
> string using the system default number format for the specified locale; 
> or you can specify zero to format the string using any user overrides to 
> the locale's default number format.

Which suggests the reverse behaviour.

AFAIK, MSDN docs have been found to be incorrect in the past, so does 
anyone know who's right?

BTW, swapping both lines to:
        if (dwflags & LOCALE_NOUSEROVERRIDE)
            used_operation = USE_SYSTEMDEFAULT;
        else
            used_operation = USE_LOCALEINFO;
does fixes both the fr_FR and en_GB locale failings and en_US continues 
to work.

I'll submit a proper patch in a moment, but I thought it best put all the
information in this email first.

Cheers,

----
Paul Millar




More information about the wine-devel mailing list