]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dataobj.cpp
SetValue is not adding a line if values does not exist
[wxWidgets.git] / src / mac / carbon / dataobj.cpp
index ebf1f0dbed73ee4844ec3b7a2b6a128e80f0da9a..bec4f2bd605d14d75b1c96f681471ddaebefa93a 100644 (file)
@@ -34,7 +34,7 @@
 #include "wx/mstream.h"
 #include "wx/image.h"
 #include "wx/mac/private.h"
-#include "Scrap.h"
+#include <Scrap.h>
 
 // ----------------------------------------------------------------------------
 // functions
@@ -166,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
 // ----------------------------------------------------------------------------
@@ -206,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;
 }