Fix wxStringOutputStream in wxUSE_UNICODE_UTF8 build.

For some reason the conversion of the bytes written to this stream to Unicode
was only done in wxUSE_UNICODE_WCHAR build but not in wxUSE_UNICODE_UTF8 one.
Do it in any wxUSE_UNICODE build now.

This allows to use wxStringOutputStream under Unix again, in particular it
fixes an assert in samples/html/zip when trying to load the raw contents of a
ZIP file in wxHtmlWindow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67968 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-06-16 16:22:15 +00:00
parent 31eb730728
commit ff8a5f3d77
2 changed files with 8 additions and 9 deletions

View File

@@ -66,9 +66,9 @@ public:
wxStringOutputStream(wxString *pString = NULL,
wxMBConv& conv = wxConvUTF8)
: m_conv(conv)
#if wxUSE_UNICODE_WCHAR
#if wxUSE_UNICODE
, m_unconv(0)
#endif // wxUSE_UNICODE_WCHAR
#endif // wxUSE_UNICODE
{
m_str = pString ? pString : &m_strInternal;
m_pos = m_str->length() / sizeof(wxChar);
@@ -98,10 +98,10 @@ private:
// arbitrary 8 bit data
wxMBConv& m_conv;
#if wxUSE_UNICODE_WCHAR
#if wxUSE_UNICODE
// unconverted data from the last call to OnSysWrite()
wxMemoryBuffer m_unconv;
#endif // wxUSE_UNICODE_WCHAR
#endif // wxUSE_UNICODE
wxDECLARE_NO_COPY_CLASS(wxStringOutputStream);
};