X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/daac16bba04f40b8a064799963dc49ec180aaae9..0d5b49cfb51c5bed477dec3cb413ef40e1612b3e:/src/msw/ole/dataobj.cpp diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 83511b7be1..3831f98b1a 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -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; @@ -1057,7 +1059,7 @@ size_t wxFileDataObject::GetDataSize() const #if wxUSE_UNICODE_MSLU size_t sizeOfChar; - if ( wxGetOsVersion() == wxWIN95 ) + if ( wxGetOsVersion() == wxOS_WINDOWS_9X ) { // Win9x always uses ANSI file names and MSLU doesn't help with this sizeOfChar = sizeof(char); @@ -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(); @@ -1111,7 +1113,7 @@ bool wxFileDataObject::GetDataHere(void *WXUNUSED_IN_WINCE(pData)) const pDrop->pFiles = sizeof(DROPFILES); pDrop->fNC = FALSE; // not non-client coords #if wxUSE_UNICODE_MSLU - pDrop->fWide = wxGetOsVersion() != wxWIN95 ? TRUE : FALSE; + pDrop->fWide = wxGetOsVersion() != wxOS_WINDOWS_9X ? TRUE : FALSE; #else pDrop->fWide = wxUSE_UNICODE; #endif @@ -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); } @@ -1159,6 +1161,12 @@ bool wxFileDataObject::GetDataHere(void *WXUNUSED_IN_WINCE(pData)) const // wxURLDataObject // ---------------------------------------------------------------------------- +// Work around bug in Wine headers +#if defined(__WINE__) && defined(CFSTR_SHELLURL) && wxUSE_UNICODE +#undef CFSTR_SHELLURL +#define CFSTR_SHELLURL _T("CFSTR_SHELLURL") +#endif + class CFSTR_SHELLURLDataObject : public wxCustomDataObject { public: