From 3df31b2d6e6ee809b2edc5cd2dac6275407c26c4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 8 May 2009 16:38:39 +0000 Subject: [PATCH] remove error message from wxCSConv initialization: there is no easy way to suppress it and no way to test if the encoding is supported so rely on calling code using IsOk() itself if necessary git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index dd1844c5b2..7c47d0c394 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -3146,31 +3146,12 @@ wxMBConv *wxCSConv::DoCreate() const delete conv; } -#endif // wxUSE_FONTMAP - - // NB: This is a hack to prevent deadlock. What could otherwise happen - // in Unicode build: wxConvLocal creation ends up being here - // because of some failure and logs the error. But wxLog will try to - // attach a timestamp, for which it will need wxConvLocal (to convert - // time to char* and then wchar_t*), but that fails, tries to log the - // error, but wxLog has an (already locked) critical section that - // guards the static buffer. - static bool alreadyLoggingError = false; - if (!alreadyLoggingError) - { - alreadyLoggingError = true; - wxLogError(_("Cannot convert from the charset '%s'!"), - m_name ? m_name - : -#if wxUSE_FONTMAP - (const char*)wxFontMapperBase::GetEncodingDescription(m_encoding).ToAscii() -#else // !wxUSE_FONTMAP - (const char*)wxString::Format(_("encoding %i"), m_encoding).ToAscii() -#endif // wxUSE_FONTMAP/!wxUSE_FONTMAP - ); - alreadyLoggingError = false; - } + wxLogTrace(TRACE_STRCONV, + wxT("encoding \"%s\" is not supported by this system"), + (m_name ? m_name + : wxFontMapperBase::GetEncodingName(m_encoding))); +#endif // wxUSE_FONTMAP return NULL; } -- 2.47.2