]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dobjcmn.cpp
wxLogTrace doesn't give messages with two 'Trace' in the beginning
[wxWidgets.git] / src / common / dobjcmn.cpp
index bf6ecc3dc90b162cc8de9bd1ccd13a4c2aceb9d6..aadd3914f34a8593225923427e20c02e703a5aa6 100644 (file)
@@ -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
 // ----------------------------------------------------------------------------