From: Václav Slavík Date: Wed, 21 Apr 2010 16:46:05 +0000 (+0000) Subject: msgIdCharset is only needed in ANSI build. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ebeac822d94fc4159962c6a7f6d721edb28d362f?ds=inline msgIdCharset is only needed in ANSI build. In Unicode build, there's no need to create wxCSConv object for every loaded catalog when it won't be used for anything. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 67bf71f86f..5459cfe1e5 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1305,6 +1305,8 @@ bool wxMsgCatalogFile::Load(const wxString& szDirPrefix, const wxString& szName, bool wxMsgCatalogFile::FillHash(wxMessagesHash& hash, const wxString& msgIdCharset) const { + wxUnusedVar(msgIdCharset); // silence warning in Unicode build + // conversion to use to convert catalog strings to the GUI encoding wxMBConv *inputConv, *inputConvPtr = NULL; // same as inputConv but safely deleteable @@ -1330,12 +1332,14 @@ bool wxMsgCatalogFile::FillHash(wxMessagesHash& hash, #endif } +#if !wxUSE_UNICODE // conversion to apply to msgid strings before looking them up: we only // need it if the msgids are neither in 7 bit ASCII nor in the same // encoding as the catalog wxCSConv *sourceConv = msgIdCharset.empty() || (msgIdCharset == m_charset) ? NULL : new wxCSConv(msgIdCharset); +#endif // !wxUSE_UNICODE for (size_t32 i = 0; i < m_numStrings; i++) { @@ -1390,7 +1394,9 @@ bool wxMsgCatalogFile::FillHash(wxMessagesHash& hash, } } +#if !wxUSE_UNICODE delete sourceConv; +#endif delete inputConvPtr; return true;