Fixes to comparison operators for wxDVC classes.
Comparison operators for wxDataViewItem and wxDataViewIconText were not inline and not exported, resulting in linking errors for any code using them in shared wx build. Fix this by making them inline. Also correct wxDataViewIconText operator==() implementation to compare icons as well and to return true when comparing the object with itself. Finally add operator!=() matching existing operator==() as a class having one of these operators is supposed to have the other one as well and it costs nothing to define it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -85,7 +85,17 @@ private:
|
||||
void* m_id;
|
||||
};
|
||||
|
||||
bool operator == (const wxDataViewItem &left, const wxDataViewItem &right);
|
||||
inline
|
||||
bool operator==(const wxDataViewItem& left, const wxDataViewItem& right)
|
||||
{
|
||||
return left.GetID() == right.GetID();
|
||||
}
|
||||
|
||||
inline
|
||||
bool operator!=(const wxDataViewItem& left, const wxDataViewItem& right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray);
|
||||
|
||||
@@ -482,7 +492,18 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDataViewIconText)
|
||||
};
|
||||
|
||||
bool operator == (const wxDataViewIconText &one, const wxDataViewIconText &two);
|
||||
inline
|
||||
bool operator==(const wxDataViewIconText& left, const wxDataViewIconText& right)
|
||||
{
|
||||
return left.GetText() == right.GetText() &&
|
||||
left.GetIcon().IsSameAs(right.GetIcon());
|
||||
}
|
||||
|
||||
inline
|
||||
bool operator!=(const wxDataViewIconText& left, const wxDataViewIconText& right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewIconText, WXDLLIMPEXP_ADV)
|
||||
|
||||
|
Reference in New Issue
Block a user