From 5e53f74af1f08e58f94d49d85c6a5e8e811cfa3c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Apr 2021 11:54:32 +0100 Subject: [PATCH] Make wxImage ctor from XPM data explicit This avoids accidental conversions from XPM to wxImage which can result in the use of an expected wxBitmap ctor later. See #19149. --- include/wx/image.h | 2 +- interface/wx/image.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/wx/image.h b/include/wx/image.h index 2a0cb489b5..125b8c707d 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -310,7 +310,7 @@ public: { LoadFile( name, type, index ); } wxImage( const wxString& name, const wxString& mimetype, int index = -1 ) { LoadFile( name, mimetype, index ); } - wxImage( const char* const* xpmData ) + explicit wxImage( const char* const* xpmData ) { Create(xpmData); } #if wxUSE_STREAMS diff --git a/interface/wx/image.h b/interface/wx/image.h index 85506f3ad4..2bf152168c 100644 --- a/interface/wx/image.h +++ b/interface/wx/image.h @@ -611,8 +611,10 @@ public: @beginWxPerlOnly Not supported by wxPerl. @endWxPerlOnly + + This constructor has become @c explicit in wxWidgets 3.1.6. */ - wxImage(const char* const* xpmData); + explicit wxImage(const char* const* xpmData); /** Creates an image from a file.