// 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<wxDropTarget *>(1);
#endif // wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT
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
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.