X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63b8dd39b88479c7171f388f9310be8a0561eb89..fc32cd4a59dc7c6cedea430750b2ce2c2a342353:/src/mac/carbon/dataobj.cpp?ds=sidebyside diff --git a/src/mac/carbon/dataobj.cpp b/src/mac/carbon/dataobj.cpp index b384ac7036..bec4f2bd60 100644 --- a/src/mac/carbon/dataobj.cpp +++ b/src/mac/carbon/dataobj.cpp @@ -34,7 +34,7 @@ #include "wx/mstream.h" #include "wx/image.h" #include "wx/mac/private.h" -#include "Scrap.h" +#include // ---------------------------------------------------------------------------- // functions @@ -86,7 +86,9 @@ void wxDataFormat::SetType( wxDataFormatId Type ) { wxFAIL_MSG( wxT("invalid dataformat") ); - m_format = '????'; + // this is '????' but it can't be used in the code because ??' is + // parsed as a trigraph! + m_format = 0x3f3f3f3f; } } @@ -164,6 +166,19 @@ bool wxDataObject::IsSupportedFormat( } } +// ---------------------------------------------------------------------------- +// wxTextDataObject +// ---------------------------------------------------------------------------- + +#if wxUSE_UNICODE +void wxTextDataObject::GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction dir) const +{ + *formats++ = wxDataFormat( wxDF_TEXT ); + *formats = wxDataFormat( wxDF_UNICODETEXT ); +} + +#endif + // ---------------------------------------------------------------------------- // wxFileDataObject // ---------------------------------------------------------------------------- @@ -204,7 +219,10 @@ bool wxFileDataObject::SetData( { m_filenames.Empty(); - AddFile(wxString::FromAscii((char*)pBuf)); + // only add if this is not an empty string + // we can therefore clear the list by just setting an empty string + if ( (*(char*)pBuf) != 0 ) + AddFile(wxString::FromAscii((char*)pBuf)); return TRUE; }