Leave NULL impl pointer in wxUILocale if locale is not supported
This finally seems better than always creating some kind of impl object, even if the locale isn't supported at all and makes all ports behave consistently, as previously CreateForLocale() only returned NULL in wxOSX implementation if the locale was unrecognized, but now all ports do this (at least when locale_t and related functions are available under Unix). Also stop returning bool from Use(), as this resulted in initializing wxLocale with any non-default language to fail under Mac: just ignore the error here, as we always did it until now, because there is nothing we can do about it anyhow.
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
#include "wx/localedefs.h"
|
||||
#include "wx/string.h"
|
||||
|
||||
// Function returning hard-coded values for the "C" locale.
|
||||
wxString wxGetStdCLocaleInfo(wxLocaleInfo index, wxLocaleCategory cat);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxUILocaleImpl provides the implementation of public wxUILocale functions
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -53,9 +56,9 @@ public:
|
||||
// Use this locale in the UI.
|
||||
//
|
||||
// This is not implemented for all platforms, notably not for Mac where the
|
||||
// UI locale is determined at application startup, and so this function
|
||||
// always returns false there.
|
||||
virtual bool Use() = 0;
|
||||
// UI locale is determined at application startup, but we can't do anything
|
||||
// about it anyhow, so we don't even bother returning an error code from it.
|
||||
virtual void Use() = 0;
|
||||
|
||||
// Functions corresponding to wxUILocale ones.
|
||||
virtual wxString GetName() const = 0;
|
||||
|
Reference in New Issue
Block a user