X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f7f50f493baa177e8ae07d12641095baee55d4f8..11c084163e3702692586f70a9414dca97bb2a2d6:/src/common/dobjcmn.cpp diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index 08b9a0e923..6560200b01 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -6,7 +6,7 @@ // Created: 19.10.99 // RCS-ID: $Id$ // Copyright: (c) wxWindows Team -// Licence: wxWindows license +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -141,7 +141,9 @@ wxDataObjectComposite::GetPreferredFormat(Direction WXUNUSED(dir)) const } #if defined(__WXMSW__) - +#ifdef __DIGITALMARS__ +extern "C" +#endif size_t wxDataObjectComposite::GetBufferOffset( const wxDataFormat& format ) { wxDataObjectSimple *dataObj = GetObject(format); @@ -152,6 +154,9 @@ size_t wxDataObjectComposite::GetBufferOffset( const wxDataFormat& format ) return dataObj->GetBufferOffset( format ); } +#ifdef __DIGITALMARS__ +extern "C" +#endif const void* wxDataObjectComposite::GetSizeFromBuffer( const void* buffer, size_t* size, const wxDataFormat& format ) @@ -164,6 +169,9 @@ const void* wxDataObjectComposite::GetSizeFromBuffer( const void* buffer, return dataObj->GetSizeFromBuffer( buffer, size, format ); } +#ifdef __DIGITALMARS__ +extern "C" +#endif void* wxDataObjectComposite::SetSizeInBuffer( void* buffer, size_t size, const wxDataFormat& format ) { @@ -234,19 +242,36 @@ bool wxDataObjectComposite::SetData(const wxDataFormat& 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; }