[wx-dev] #9522: wxTextDataObject forgets trailing \0
wxTrac
noreply at wxsite.net
Mon Jun 2 06:32:43 PDT 2008
Ticket URL: <http://trac.wxwidgets.org/ticket/9522>
#9522: wxTextDataObject forgets trailing \0
------------------------------+---------------------------------------------
Reporter: doornik | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxMac | Version: 2.8.x
Keywords: wxTextDataObject | Blockedby:
Patch: 1 | Blocking:
------------------------------+---------------------------------------------
This is a patch for common/dobjcmn.cpp, but it applies to code that is
only for wxMAC with UNICODE.
wxTextDataObject::GetTextLength() uses +1 for the trailing \0. However,
neither GetDataSize nor GetDataHere take the trailing \0 into account
(just one byte, because the string is passed around as UTF8).
This leads intermittently to spurious characters being appended when using
wxTextDataObject for drag and drop (e.g.).
The #if defined(__WXGTK20__) && wxUSE_UNICODE version of the code looks
suspicious as well, but I haven't tested this.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/9522>
More information about the wx-dev
mailing list