]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
another segfault fix
[wxWidgets.git] / src / msw / textctrl.cpp
index c4803778fedc7295da921f8afb22ea05d18c4efa..c64bfb06e8f1d7c37eb245124ef9614ae4a207ea 100644 (file)
@@ -468,6 +468,7 @@ extern long wxEncodingToCodepage(wxFontEncoding encoding); // from strconv.cpp
 
 bool wxTextCtrl::StreamIn(const wxString& value, wxFontEncoding encoding)
 {
+#if !wxUSE_UNICODE
     // we have to use EM_STREAMIN to force richedit control 2.0+ to show any
     // text in the non default charset - otherwise it thinks it knows better
     // than we do and always shows it in the default one
@@ -491,6 +492,9 @@ bool wxTextCtrl::StreamIn(const wxString& value, wxFontEncoding encoding)
 
     // finally, stream it in the control
     const wchar_t *wpc = wchBuf;
+#else
+    const wchar_t *wpc = value.c_str();
+#endif
 
     EDITSTREAM eds;
     wxZeroMemory(eds);