From ece6626a59a491350fe6f38fbbde349eae5b42be Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 30 Jan 2019 15:03:05 +0000 Subject: [PATCH] Switch wxQt to use UTF-8 for text data transfer via wxDataObject. The result otherwise was less than useful. --- include/wx/dataobj.h | 2 +- src/qt/dataobj.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/wx/dataobj.h b/include/wx/dataobj.h index 348ad20286..885a75d5a9 100644 --- a/include/wx/dataobj.h +++ b/include/wx/dataobj.h @@ -322,7 +322,7 @@ private: // ---------------------------------------------------------------------------- #if wxUSE_UNICODE - #if defined(__WXGTK20__) || defined(__WXX11__) + #if defined(__WXGTK20__) || defined(__WXX11__) || defined(__WXQT__) #define wxNEEDS_UTF8_FOR_TEXT_DATAOBJ #elif defined(__WXMAC__) #define wxNEEDS_UTF16_FOR_TEXT_DATAOBJ diff --git a/src/qt/dataobj.cpp b/src/qt/dataobj.cpp index e6f8f6e1be..463677d497 100644 --- a/src/qt/dataobj.cpp +++ b/src/qt/dataobj.cpp @@ -157,6 +157,20 @@ wxBitmapDataObject::wxBitmapDataObject( const wxBitmap &WXUNUSED(bitmap) ) { } +//############################################################################# +// ---------------------------------------------------------------------------- +// wxTextDataObject +// ---------------------------------------------------------------------------- + +#if wxUSE_UNICODE +void wxTextDataObject::GetAllFormats(wxDataFormat *formats, + wxDataObjectBase::Direction WXUNUSED(dir)) const +{ + formats[0] = wxDataFormat(wxDF_UNICODETEXT); + formats[1] = wxDataFormat(wxDF_TEXT); +} +#endif + //############################################################################# wxFileDataObject::wxFileDataObject()