From 7a906e1a2125a3db29b9777ad2384485d2f78ea4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 9 Oct 2007 00:01:59 +0000 Subject: [PATCH] fixed operator<<(ostream&, wxString) to output string contents and not wchar_t pointer value in Unicode build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/string.h | 2 +- src/common/string.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/wx/string.h b/include/wx/string.h index 3b112d582d..1710a2e165 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -3031,7 +3031,7 @@ WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxCharBuffer&); WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxWCharBuffer&); #endif -#endif // wxSTD_STRING_COMPATIBILITY +#endif // wxUSE_STD_IOSTREAM // --------------------------------------------------------------------------- // wxCStrData implementation diff --git a/src/common/string.cpp b/src/common/string.cpp index fbfe6cb6b5..36efc0ce8e 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -72,11 +72,10 @@ const size_t wxString::npos = (size_t) -1; wxSTD ostream& operator<<(wxSTD ostream& os, const wxCStrData& str) { -// FIXME-UTF8: always, not only if wxUSE_UNICODE -#if wxUSE_UNICODE && !defined(__BORLANDC__) - return os << (const wchar_t*)str.AsWCharBuf(); +#if wxUSE_UNICODE && !wxUSE_UNICODE_UTF8 + return os << (const char *)str.AsCharBuf(); #else - return os << (const char*)str.AsCharBuf(); + return os << str.AsInternal(); #endif }