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
-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);
WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray);
DECLARE_DYNAMIC_CLASS(wxDataViewIconText)
};
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)
DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewIconText, WXDLLIMPEXP_ADV)
const char wxDataViewCtrlNameStr[] = "dataviewCtrl";
const char wxDataViewCtrlNameStr[] = "dataviewCtrl";
-
-bool operator == (const wxDataViewItem &left, const wxDataViewItem &right)
-{
- return (left.GetID() == right.GetID() );
-}
-
// ---------------------------------------------------------
// wxDataViewModelNotifier
// ---------------------------------------------------------
// ---------------------------------------------------------
// wxDataViewModelNotifier
// ---------------------------------------------------------
IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxDataViewIconText, WXDLLIMPEXP_ADV)
IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxDataViewIconText, WXDLLIMPEXP_ADV)
-bool operator == (const wxDataViewIconText &one, const wxDataViewIconText &two)
-{
- if (one.GetText() != two.GetText()) return false;
- if (one.IsSameAs(two)) return false;
- return true;
-}
-
// ---------------------------------------------------------
// wxDataViewRendererBase
// ---------------------------------------------------------
// ---------------------------------------------------------
// wxDataViewRendererBase
// ---------------------------------------------------------