X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9fc0fe377b42853e23cb771a2d9a742b9c91a996..29f7914424a7941e9374a5445f95574f2f041659:/src/common/stream.cpp diff --git a/src/common/stream.cpp b/src/common/stream.cpp index 305c8c5128..d5954d71d8 100644 --- a/src/common/stream.cpp +++ b/src/common/stream.cpp @@ -340,7 +340,7 @@ size_t wxStreamBuffer::Read(wxStreamBuffer *s_buf) if (m_mode == write) return 0; - while (bytes_read == BUF_TEMP_SIZE) { + while (bytes_read != 0) { bytes_read = Read(buf, bytes_read); bytes_read = s_buf->Write(buf, bytes_read); s += bytes_read; @@ -752,7 +752,12 @@ wxOutputStream& wxOutputStream::operator<<(const char *string) wxOutputStream& wxOutputStream::operator<<(wxString& string) { +#if wxUSE_UNICODE + const wxWX2MBbuf buf = string.mb_str(); + return *this << buf; +#else return Write(string, string.Len()); +#endif } wxOutputStream& wxOutputStream::operator<<(char c) @@ -764,32 +769,32 @@ wxOutputStream& wxOutputStream::operator<<(short i) { wxString strint; - strint.Printf("%i", i); - return Write(strint, strint.Len()); + strint.Printf(_T("%i"), i); + return *this << strint; } wxOutputStream& wxOutputStream::operator<<(int i) { wxString strint; - strint.Printf("%i", i); - return Write(strint, strint.Len()); + strint.Printf(_T("%i"), i); + return *this << strint; } wxOutputStream& wxOutputStream::operator<<(long i) { wxString strlong; - strlong.Printf("%i", i); - return Write((const char *)strlong, strlong.Len()); + strlong.Printf(_T("%i"), i); + return *this << strlong; } wxOutputStream& wxOutputStream::operator<<(double f) { wxString strfloat; - strfloat.Printf("%f", f); - return Write(strfloat, strfloat.Len()); + strfloat.Printf(_T("%f"), f); + return *this << strfloat; } #if wxUSE_SERIAL