]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ole/dataobj.cpp
correction to last commit: don't test unsetenv() return value, it's void under Darwin
[wxWidgets.git] / src / msw / ole / dataobj.cpp
index d4ec164a93c4a56b025534c9fb5feb0edf710b6b..3831f98b1a266b1de2a0129efadee21dd8986fa5 100644 (file)
@@ -28,6 +28,7 @@
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/utils.h"
+    #include "wx/wxcrtvararg.h"
 #endif
 
 #include "wx/dataobj.h"
@@ -136,9 +137,9 @@ private:
 // wxDataFormat
 // ----------------------------------------------------------------------------
 
-void wxDataFormat::SetId(const wxChar *format)
+void wxDataFormat::SetId(const wxString& format)
 {
-    m_format = (wxDataFormat::NativeFormat)::RegisterClipboardFormat(format);
+    m_format = (wxDataFormat::NativeFormat)::RegisterClipboardFormat(format.wx_str());
     if ( !m_format )
     {
         wxLogError(_("Couldn't register clipboard format '%s'."), format);
@@ -159,6 +160,7 @@ wxString wxDataFormat::GetId() const
     if ( !len )
     {
         wxLogError(_("The clipboard format '%d' doesn't exist."), m_format);
+        return wxEmptyString;
     }
 
     return s;
@@ -1080,7 +1082,7 @@ size_t wxFileDataObject::GetDataSize() const
         size_t len;
 #if wxUSE_UNICODE_MSLU
         if ( sizeOfChar == sizeof(char) )
-            len = strlen(wxConvFileName->cWC2MB(m_filenames[i]));
+            len = strlen(m_filenames[i].mb_str(*wxConvFileName));
         else
 #endif // wxUSE_UNICODE_MSLU
             len = m_filenames[i].length();
@@ -1129,7 +1131,7 @@ bool wxFileDataObject::GetDataHere(void *WXUNUSED_IN_WINCE(pData)) const
 #if wxUSE_UNICODE_MSLU
         if ( sizeOfChar == sizeof(char) )
         {
-            wxCharBuffer buf(wxConvFileName->cWC2MB(m_filenames[i]));
+            wxCharBuffer buf(m_filenames[i].mb_str(*wxConvFileName));
             len = strlen(buf);
             memcpy(pbuf, buf, len*sizeOfChar);
         }