]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for a crash due to using NULL inputConv in Unicode build introduced in rev 1.162
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 28 Sep 2005 09:41:55 +0000 (09:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 28 Sep 2005 09:41:55 +0000 (09:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/intl.cpp

index 31332b83ba557238841a5fa852c13997f33e7dde..911dfaa1464a730eb80465d65af74f2a46ba2c90 100644 (file)
@@ -1254,14 +1254,23 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash,
     if ( convertEncoding )
     {
         if ( m_charset.empty() )
+        {
             inputConv = wxConvCurrent;
+        }
         else
+        {
             inputConv =
             csConv = new wxCSConv(m_charset);
+        }
     }
-    else // no conversion needed
+    else // no need to convert the encoding
     {
+        // we still need the conversion for Unicode build
+#if wxUSE_UNICODE
+        inputConv = wxConvCurrent;
+#else // !wxUSE_UNICODE
         inputConv = NULL;
+#endif // wxUSE_UNICODE/!wxUSE_UNICODE
     }
 
     // conversion to apply to msgid strings before looking them up: we only
@@ -1315,11 +1324,11 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash,
         wxString msgid(data, *inputConv);
 #else // ASCII
         wxString msgid;
-#if wxUSE_WCHAR_T
-        if ( inputConv && sourceConv )
-            msgid = wxString(inputConv->cMB2WC(data), *sourceConv);
-        else
-#endif
+        #if wxUSE_WCHAR_T
+            if ( inputConv && sourceConv )
+                msgid = wxString(inputConv->cMB2WC(data), *sourceConv);
+            else
+        #endif
             msgid = data;
 #endif // wxUSE_UNICODE