// wxDataObjectComposite
// ----------------------------------------------------------------------------
+wxDataObjectComposite::wxDataObjectComposite()
+{
+ m_preferred = 0;
+
+ m_dataObjects.DeleteContents(TRUE);
+}
+
wxDataObjectSimple *
wxDataObjectComposite::GetObject(const wxDataFormat& format) const
{
{
wxDataObjectSimple *dataObj = GetObject(format);
- wxCHECK_MSG( dataObj, FALSE,
+ wxCHECK_MSG( dataObj, 0,
wxT("unsupported format in wxDataObjectComposite"));
return dataObj->GetBufferOffset( format );
{
wxDataObjectSimple *dataObj = GetObject(format);
- wxCHECK_MSG( dataObj, FALSE,
+ wxCHECK_MSG( dataObj, NULL,
wxT("unsupported format in wxDataObjectComposite"));
return dataObj->GetSizeFromBuffer( buffer, size, format );
{
wxDataObjectSimple *dataObj = GetObject(format);
- wxCHECK_MSG( dataObj, FALSE,
+ wxCHECK_MSG( dataObj, NULL,
wxT("unsupported format in wxDataObjectComposite"));
return dataObj->SetSizeInBuffer( buffer, size, format );
size_t wxTextDataObject::GetDataSize() const
{
+#if defined(__WXGTK20__) && wxUSE_UNICODE
+ // Use UTF8 not UCS4
+ wxCharBuffer buffer = wxConvUTF8.cWX2MB( GetText().c_str() );
+ return strlen( (const char*) buffer ) + 1;
+#else
return GetTextLength() * sizeof(wxChar);
+#endif
}
bool wxTextDataObject::GetDataHere(void *buf) const
{
+#if defined(__WXGTK20__) && wxUSE_UNICODE
+ // Use UTF8 not UCS4
+ wxCharBuffer buffer = wxConvUTF8.cWX2MB( GetText().c_str() );
+ strcpy( (char*) buf, (const char*) buffer );
+#else
wxStrcpy((wxChar *)buf, GetText().c_str());
+#endif
return TRUE;
}
bool wxTextDataObject::SetData(size_t WXUNUSED(len), const void *buf)
{
+#if defined(__WXGTK20__) && wxUSE_UNICODE
+ // Use UTF8 not UCS4
+ SetText( wxConvUTF8.cMB2WX( (const char*) buf ) );
+#else
SetText(wxString((const wxChar *)buf));
+#endif
return TRUE;
}