X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/574c939ef1c1b835a8bc65c0fe724548fa04ec49..e7300ec6d9ebbd1cfa2fcf12c0ce6e5aee85a152:/src/msw/ole/dataobj.cpp?ds=sidebyside diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index e816a3d629..309a999059 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -293,7 +293,7 @@ STDMETHODIMP wxIDataObject::GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmedium) // for the bitmaps and metafiles we use the handles instead of global memory // to pass the data - wxDataFormat format = (wxDataFormatId)pformatetcIn->cfFormat; + wxDataFormat format = (wxDataFormat::NativeFormat)pformatetcIn->cfFormat; switch ( format ) { @@ -1065,7 +1065,8 @@ bool wxFileDataObject::GetDataHere(void *pData) const // wxURLDataObject // ---------------------------------------------------------------------------- -class CFSTR_SHELLURLDataObject:public wxCustomDataObject + +class CFSTR_SHELLURLDataObject : public wxCustomDataObject { public: CFSTR_SHELLURLDataObject() : wxCustomDataObject(CFSTR_SHELLURL) {} @@ -1089,6 +1090,7 @@ protected: { return buffer; } + #if wxUSE_UNICODE virtual bool GetDataHere( void* buffer ) const { @@ -1104,6 +1106,8 @@ protected: #endif }; + + wxURLDataObject::wxURLDataObject() { // we support CF_TEXT and CFSTR_SHELLURL formats which are basicly the same @@ -1143,8 +1147,13 @@ wxString wxURLDataObject::GetURL() const void wxURLDataObject::SetURL(const wxString& url) { - SetData(wxDataFormat(wxDF_TEXT), url.Length()+1, url.c_str()); - SetData(wxDataFormat(CFSTR_SHELLURL), url.Length()+1, url.c_str()); + SetData(wxDataFormat(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT), + url.Length()+1, url.c_str()); + + // CFSTR_SHELLURL is always supposed to be ANSI... + wxWX2MBbuf urlA = (wxWX2MBbuf)url.mbc_str(); + size_t len = strlen(urlA); + SetData(wxDataFormat(CFSTR_SHELLURL), len+1, (const char*)urlA); } // ----------------------------------------------------------------------------