On my Mac (Snow Leopard) I am using the somewhat non-standard configuration of 
an English-language UI but with an otherwise German locale (dates/times, 
measurement units, etc.).  That is, "System Preferences" - "Language & Text" - 
"Formats" - "Region" for me is "Germany (English)".  (On the other hand, my 
~/.bash_profile configures the LANG/LC_* environment variables so that "locale" 
reports "en_US.UTF-8".  Things mostly seem to work fine that way.)

However, many of the OOo unoapi tests fail for me (DEV300_m76 unxmacxi.pro).  
What appears to happen is the following:

qadevOOo/tests/java/ifc/accessibility/_XAccesibleContext.java checks that a 
com.sun.star.accessibility.XAccessibleContext.getLocale UNO method returns a 
com.sun.star.lang.Locale that has a non-empty Country member.  The 
implementation of that method (toolkit/source/awt/vclxaccessiblecomponent.cxx) 
simply returns Application::GetSettings().GetLocale().  That 
(vcl/source/app/settings.cxx) in turn calls SvtSysLocale::GetLocale, which 
(unotools/source/misc/syslocale.cxx) in turn calls 
SvtSysLocaleOptions::GetRealLocale, which 
(unotools/source/config/syslocaleoptions.cxx) relies on 
SvtSysLocaleOptions_Impl::MakeRealLocale.  This internally uses

  m_eRealLanguage = MsLangId::getSystemLanguage();
  MsLangId::convertLanguageToLocale(m_eRealLanguage, m_aRealLanguage);

First, MsLangId::getSystemLanguage (i18npool/inc/i18npool/mslangid.hxx) calls 
getPlatformSystemLanguageImpl (i18npool/source/isolang/inunx.cxx).  That, for 
MACOSX, uses osl_getProcessLocale to obtain a locale (with rLang="en" and 
rCountry="DE" in my case, as it internally favors 
CFPreferencesCopyAppValue("AppleLocale") over inspecting the LANG/LC_* 
environment variables), but then calls 
MsLangId::convertIsoNamesToLanguage(rLang, rCountry), which has nothing more 
specific than LANGUAGE_ENGLISH to represent that odd language/country 
combination.

Thus, second, MsLangId::convertLanguageToLocale has lost the country 
information ("DE"), so will produce a Locale instance that only has language 
information ("en").  Up all the levels again, this will make the unoapi check 
in _XAccessibleContext.java fail.

Now, where is the error?

- SvtSysLocaleOptions_Impl::MakeRealLocale 
(unotools/source/config/syslocaleoptions.cxx) obtaining a LanguageType enum 
value to create a Locale from it looks wrong, as the LanguageType enum 
obviously cannot encode all the relevant information.

- However, is _XAccessibleContext.java correct in requiring a non-empty Country 
member?  The documentation of the com.sun.star.lang.Locale UNO struct specifies 
for the Country member:  "If this field contains an empty string, the meaning 
depends on the context."  I lack the context here to judge whether 
com.sun.star.accessibility.XAccessibleContext.getLocale may legitimately return 
a Locale that "depends on the context" in this way...

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to