]> git.saurik.com Git - wxWidgets.git/commitdiff
msgIdCharset is only needed in ANSI build.
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 21 Apr 2010 16:46:05 +0000 (16:46 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 21 Apr 2010 16:46:05 +0000 (16:46 +0000)
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

src/common/intl.cpp

index 67bf71f86f884527cad50cb1c0d2c8c99814ea41..5459cfe1e547d70ba8d4f2147847dad78cc747cf 100644 (file)
@@ -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;