assert in AddCatalog() if Init() hadn't been called and also check that we have a valid language spec in wxMsgCatalogFile::Load() to ensure we don't form invalid paths there; call Init() before AddCatalog() in the sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1177,6 +1177,9 @@ static wxString GetFullSearchPath(const wxString& lang)
|
||||
bool wxMsgCatalogFile::Load(const wxString& szDirPrefix, const wxString& szName,
|
||||
wxPluralFormsCalculatorPtr& rPluralFormsCalculator)
|
||||
{
|
||||
wxCHECK_MSG( szDirPrefix.length() >= LEN_LANG, false,
|
||||
"invalid language specification" );
|
||||
|
||||
wxString searchPath;
|
||||
|
||||
#if wxUSE_FONTMAP
|
||||
@@ -2570,6 +2573,8 @@ bool wxLocale::AddCatalog(const wxString& szDomain,
|
||||
const wxString& msgIdCharset)
|
||||
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), false, "must initialize catalog first" );
|
||||
|
||||
wxMsgCatalog *pMsgCat = new wxMsgCatalog;
|
||||
|
||||
if ( pMsgCat->Load(m_strShort, szDomain, msgIdCharset, m_bConvertEncoding) )
|
||||
|
Reference in New Issue
Block a user