X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f08b2509bc94079a0a0203ecee862a23f938721..75f661bbc8f9d44f6899aca0fd3afa98224ecf4d:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 47ec9ab448..0f4ac931a7 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -82,7 +82,7 @@ // dummy value used for m_dropTarget, different from any valid pointer value // (which are all even under Windows) and NULL static wxDropTarget * - wxRICHTEXT_DEFAULT_DROPTARGET = wx_reinterpret_cast(wxDropTarget *, 1); + wxRICHTEXT_DEFAULT_DROPTARGET = reinterpret_cast(1); #endif // wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT @@ -990,15 +990,10 @@ wxTextCtrl::StreamIn(const wxString& value, if (len == wxCONV_FAILED) return false; -#if wxUSE_WCHAR_T - wxWCharBuffer wchBuf(len); + wxWCharBuffer wchBuf(len); // allocates one extra character wchar_t *wpc = wchBuf.data(); -#else - wchar_t *wchBuf = (wchar_t *)malloc((len + 1)*sizeof(wchar_t)); - wchar_t *wpc = wchBuf; -#endif - conv.MB2WC(wpc, value.mb_str(), value.length()); + conv.MB2WC(wpc, value.mb_str(), len + 1); #endif // wxUSE_UNICODE_MSLU // finally, stream it in the control @@ -1922,7 +1917,7 @@ WXLRESULT wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara else // !editable { // NB: use "=", not "|=" as the base class version returns - // the same flags is this state as usual (i.e. + // the same flags in the disabled state as usual (i.e. // including DLGC_WANTMESSAGE). This is strange (how // does it work in the native Win32 apps?) but for now // live with it.