X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fcbe123e4881886b9f5b78a1482af73ecbe5da6c..40e32bca6c12a7068cded7cf5a39381e78b1b6b1:/src/common/txtstrm.cpp diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index 0f23ce65ab..93bc7ad912 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -417,6 +417,16 @@ void wxTextOutputStream::WriteString(const wxString& string) #endif } +wxTextOutputStream& wxTextOutputStream::PutChar(wxChar c) +{ +#if wxUSE_UNICODE + WriteString( wxString(&c, m_conv, 1) ); +#else + WriteString( wxString(&c, wxConvLocal, 1) ); +#endif + return *this; +} + wxTextOutputStream& wxTextOutputStream::operator<<(const wxChar *string) { WriteString( wxString(string) ); @@ -497,17 +507,7 @@ wxTextOutputStream& wxTextOutputStream::operator<<(float f) wxTextOutputStream &endl( wxTextOutputStream &stream ) { - //RN: Normally a single char on builds without a real - //wchar_t will call the version that corresponds to the - //numeric value of wchar_t itself (wxUint16 if 2 bytes etc.), - //which is not what we want (will print a 10 numeric value, - //not a newline). Thus, we need to send it a string in that - // case instead so that it correctly prints the newline. -#if !wxUSE_UNICODE || wxWCHAR_T_IS_REAL_TYPE - return stream << wxT('\n'); -#else - return stream << wxT("\n"); -#endif + return stream.PutChar(wxT('\n')); } #endif