From ce6f8d6fb3613a15232ccbd4ebefc22194bcbdc9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 18 Sep 2005 16:40:24 +0000 Subject: [PATCH] added trace message to wxCSConv creation code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 4de3f0927a..878e909465 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -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