X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/31e78e0cb6e8463c43349502b78c8095a0021d00..069d0f27ef7d87fd337e6baad1c5f4c7223ed693:/src/common/dobjcmn.cpp diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index bf6ecc3dc9..aadd3914f3 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -61,6 +61,33 @@ wxDataObjectBase::~wxDataObjectBase() { } +bool wxDataObjectBase::IsSupported(const wxDataFormat& format, + Direction dir) const +{ + size_t nFormatCount = GetFormatCount(dir); + if ( nFormatCount == 1 ) + { + return format == GetPreferredFormat(dir); + } + else + { + wxDataFormat *formats = new wxDataFormat[nFormatCount]; + GetAllFormats(formats, dir); + + size_t n; + for ( n = 0; n < nFormatCount; n++ ) + { + if ( formats[n] == format ) + break; + } + + delete [] formats; + + // found? + return n < nFormatCount; + } +} + // ---------------------------------------------------------------------------- // wxDataObjectComposite // ----------------------------------------------------------------------------