From: Vadim Zeitlin Date: Thu, 15 Mar 2012 13:49:49 +0000 (+0000) Subject: Pass the original format to wxDataObjectSimple in wxDataObjectComposite. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d361ea0db52530cffcce3ef2dd92f9b1516288c6 Pass the original format to wxDataObjectSimple in wxDataObjectComposite. Some "simple" data objects, such as wxTextDataObject, are actually not simple and support multiple formats so pass the real format to them so that they could do the right thing. Closes #14101. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index f019177524..ebe87267b7 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -234,7 +234,12 @@ bool wxDataObjectComposite::SetData(const wxDataFormat& format, wxT("unsupported format in wxDataObjectComposite")); m_receivedFormat = format; - return dataObj->SetData( len, buf ); + + // Notice that we must pass "format" here as wxTextDataObject, that we can + // have as one of our "simple" sub-objects actually is not that simple and + // can support multiple formats (ASCII/UTF-8/UTF-16/...) and so needs to + // know which one it is given. + return dataObj->SetData( format, len, buf ); } // ----------------------------------------------------------------------------