]> git.saurik.com Git - wxWidgets.git/commitdiff
added trace message to wxCSConv creation code
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Sep 2005 16:40:24 +0000 (16:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 18 Sep 2005 16:40:24 +0000 (16:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/strconv.cpp

index 4de3f0927adbd3c446e27fc5ca0aec3c53284217..878e90946529dd713a45210f9338d77e85ff6ba1 100644 (file)
@@ -83,6 +83,9 @@
 
 #include  "wx/mac/private.h"  // includes mac headers
 #endif
+
+#define TRACE_STRCONV _T("strconv")
+
 // ----------------------------------------------------------------------------
 // macros
 // ----------------------------------------------------------------------------
@@ -1425,11 +1428,11 @@ wxMBConv_iconv::wxMBConv_iconv(const wxChar *name)
 
                 // VS: we must not output an error here, since wxWidgets will safely
                 //     fall back to using wxEncodingConverter.
-                wxLogTrace(wxT("strconv"), wxT("Impossible to convert to/from charset '%s' with iconv, falling back to wxEncodingConverter."), name);
+                wxLogTrace(TRACE_STRCONV, wxT("Impossible to convert to/from charset '%s' with iconv, falling back to wxEncodingConverter."), name);
                 //wxLogError(
             }
         }
-        wxLogTrace(wxT("strconv"), wxT("wchar_t charset is '%s', needs swap: %i"), ms_wcCharsetName, ms_wcNeedsSwap);
+        wxLogTrace(TRACE_STRCONV, wxT("wchar_t charset is '%s', needs swap: %i"), ms_wcCharsetName, ms_wcNeedsSwap);
     }
     else // we already have ms_wcCharsetName
     {
@@ -1515,7 +1518,7 @@ size_t wxMBConv_iconv::MB2WC(wchar_t *buf, const char *psz, size_t n) const
     if (ICONV_FAILED(cres, inbuf))
     {
         //VS: it is ok if iconv fails, hence trace only
-        wxLogTrace(wxT("strconv"), wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
+        wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
         return (size_t)-1;
     }
 
@@ -1583,7 +1586,7 @@ size_t wxMBConv_iconv::WC2MB(char *buf, const wchar_t *psz, size_t n) const
     if (ICONV_FAILED(cres, inbuf))
     {
         //VS: it is ok if iconv fails, hence trace only
-        wxLogTrace(wxT("strconv"), wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
+        wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode()));
         return (size_t)-1;
     }
 
@@ -2520,6 +2523,13 @@ static wxEncodingNameCache gs_nameCache;
 
 wxMBConv *wxCSConv::DoCreate() const
 {
+#if wxUSE_FONTMAP
+    wxLogTrace(TRACE_STRCONV,
+               wxT("creating conversion for %s"),
+               (m_name ? m_name
+                       : wxFontMapperBase::GetEncodingName(m_encoding).c_str()));
+#endif // wxUSE_FONTMAP
+
     // check for the special case of ASCII or ISO8859-1 charset: as we have
     // special knowledge of it anyhow, we don't need to create a special
     // conversion object