Check that locale ID argument of wxUILocale ctor is not empty
Disallow using empty wxLocaleIdent here, GetDefault() can, and should, be used for the user default locale.
This commit is contained in:
@@ -109,7 +109,8 @@ public:
|
||||
see wxLocaleIdent description for more details.
|
||||
|
||||
If @a localeId is not recognized or not supported, default ("C") locale
|
||||
is used instead.
|
||||
is used instead. Additionally, if @a localeId is empty (see
|
||||
wxLocaleIdent::IsEmpty()), an assertion failure is triggered.
|
||||
*/
|
||||
explicit wxUILocale(const wxLocaleIdent& localeId);
|
||||
|
||||
|
@@ -158,6 +158,13 @@ const wxUILocale& wxUILocale::GetCurrent()
|
||||
|
||||
wxUILocale::wxUILocale(const wxLocaleIdent& localeId)
|
||||
{
|
||||
if ( localeId.IsEmpty() )
|
||||
{
|
||||
wxFAIL_MSG( "Locale identifier must be initialized" );
|
||||
m_impl = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
m_impl = wxUILocaleImpl::CreateForLocale(localeId);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user