Handle comparisons of boolean and icon-text items in wxDataViewModel.

For some reasons these types were not handled in wxDataViewModel::Compare(),
unlike all the other standard ones.

Closes #15407.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-10-07 09:58:41 +00:00
parent 7c7cfb16d3
commit 1efdf9cd65

View File

@@ -352,6 +352,26 @@ int wxDataViewModel::Compare( const wxDataViewItem &item1, const wxDataViewItem
if (dt2.IsEarlierThan(dt1))
return -1;
}
else if (value1.GetType() == wxT("bool"))
{
bool b1 = value1.GetBool();
bool b2 = value2.GetBool();
if (b1 != b2)
return b1 ? 1 : -1;
}
else if (value1.GetType() == wxT("wxDataViewIconText"))
{
wxDataViewIconText iconText1, iconText2;
iconText1 << value1;
iconText2 << value2;
int res = iconText1.GetText().Cmp(iconText2.GetText());
if (res != 0)
return res;
}
// items must be different
wxUIntPtr id1 = wxPtrToUInt(item1.GetID()),