Don't use wxASCII_STR() inside wxART_MAKE_XXX_ID macros
This changed the type of the art and client ID values, which broke
compatibility with existing code, notably in wxPython (see
https://github.com/wxWidgets/wxWidgets/pull/1996), and the attempts to
fix this compatibility broke it with all the existing code using
wxART_MAKE_ART_ID() or wxART_MAKE_CLIENT_ID() for their own IDs.
Keep things simple and just define the macros as they were defined
before 4552009805
(Merge branch 'pr1312-no-unsafe-wxstring-conv',
2020-07-20), except for wxART_MAKE_CLIENT_ID_FROM_STR() whose argument
and produced value was already of wxString type, and use wxASCII_STR()
at the place of use of wxART_XXX constants in wx code.
This is obviously not ideal as it will require using wxASCII_STR() in
the application code as well, but seems to be the least evil.
This commit is contained in:
@@ -565,27 +565,27 @@ public:
|
||||
|
||||
// Gets a bitmap.
|
||||
wxBitmap GetBitmap(const wxString& param = wxT("bitmap"),
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) wxOVERRIDE;
|
||||
|
||||
// Gets a bitmap from an XmlNode.
|
||||
wxBitmap GetBitmap(const wxXmlNode* node,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) wxOVERRIDE;
|
||||
|
||||
// Gets an icon.
|
||||
wxIcon GetIcon(const wxString& param = wxT("icon"),
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) wxOVERRIDE;
|
||||
|
||||
// Gets an icon from an XmlNode.
|
||||
wxIcon GetIcon(const wxXmlNode* node,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER),
|
||||
wxSize size = wxDefaultSize) wxOVERRIDE;
|
||||
|
||||
// Gets an icon bundle.
|
||||
wxIconBundle GetIconBundle(const wxString& param,
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER) wxOVERRIDE;
|
||||
const wxArtClient& defaultArtClient = wxASCII_STR(wxART_OTHER)) wxOVERRIDE;
|
||||
|
||||
// Gets an image list.
|
||||
wxImageList *GetImageList(const wxString& param = wxT("imagelist")) wxOVERRIDE;
|
||||
|
Reference in New Issue
Block a user