Fixed infinite loop crash from string comparison

feature/develop-atys
Nimetu 4 years ago
parent ea1b3dbc28
commit 65415dfc55

@ -46,7 +46,7 @@ namespace NLGUI
static inline bool lt_text(const std::pair<int,std::string> &s1, const std::pair<int,std::string> &s2)
{
// return toLower(s1.second) < toLower(s2.second);
return -NLMISC::compareCaseInsensitive(s1.second, s2.second);
return NLMISC::compareCaseInsensitive(s1.second, s2.second) < 0;
}
std::string CDBGroupComboBox::measureMenu;

@ -195,7 +195,7 @@ bool CPeopleList::sortExByContactId(const CPeople& a, const CPeople& b)
//==================================================================
bool CPeopleList::sortExByName(const CPeople& a, const CPeople& b)
{
return -NLMISC::compareCaseInsensitive(a.getName(), b.getName()); // FIXME: Locale-dependent sort
return NLMISC::compareCaseInsensitive(a.getName(), b.getName()) < 0; // FIXME: Locale-dependent sort
}
//==================================================================
@ -204,7 +204,7 @@ bool CPeopleList::sortExByOnline(const CPeople& a, const CPeople& b)
// We want order: online/alpha, offworld/alpha, offline/alpha
if (a.Online == b.Online)
{
return -NLMISC::compareCaseInsensitive(a.getName(), b.getName()); // FIXME: Locale-dependent sort
return NLMISC::compareCaseInsensitive(a.getName(), b.getName()) < 0; // FIXME: Locale-dependent sort
}
else
{

Loading…
Cancel
Save