Fix building wxMSW using GCC 10.1 with C++20 standard
Add comparison operator overloads using NativeFormat to wxDataFormat to prevent ambiguous operator overload errors. Closes https://github.com/wxWidgets/wxWidgets/pull/1962
This commit is contained in:
parent
7f617d97a5
commit
88a6c8c905
@ -41,6 +41,8 @@ public:
|
||||
bool operator!=(wxDataFormatId format) const;
|
||||
bool operator==(const wxDataFormat& format) const;
|
||||
bool operator!=(const wxDataFormat& format) const;
|
||||
bool operator==(NativeFormat format) const;
|
||||
bool operator!=(NativeFormat format) const;
|
||||
|
||||
// explicit and implicit conversions to NativeFormat which is one of
|
||||
// standard data types (implicit conversion is useful for preserving the
|
||||
|
@ -369,6 +369,16 @@ bool wxDataFormat::operator!=(const wxDataFormat& format) const
|
||||
return !(*this == format);
|
||||
}
|
||||
|
||||
bool wxDataFormat::operator==(NativeFormat format) const
|
||||
{
|
||||
return HtmlFormatFixup(*this).m_format == format;
|
||||
}
|
||||
|
||||
bool wxDataFormat::operator!=(NativeFormat format) const
|
||||
{
|
||||
return !(*this == format);
|
||||
}
|
||||
|
||||
void wxDataFormat::SetId(const wxString& format)
|
||||
{
|
||||
m_format = (wxDataFormat::NativeFormat)::RegisterClipboardFormat(format.t_str());
|
||||
|
Loading…
Reference in New Issue
Block a user