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.
This commit is contained in:
Vadim Zeitlin
2021-04-17 11:54:32 +01:00
parent 72500faf7c
commit 5e53f74af1
2 changed files with 4 additions and 2 deletions

View File

@@ -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

View File

@@ -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.