Use locale- and platform-dependent comparison when sorting dictionaries (issue #676)

This commit is contained in:
Abs62 2016-02-21 12:07:31 +03:00
parent cabc5aa7c3
commit 7fa2df772e

View file

@ -24,7 +24,7 @@ bool dictNameLessThan( sptr< Dictionary::Class > const & dict1,
if( !str1.isEmpty() && str2.isEmpty() )
return true;
return str1.compare( str2, Qt::CaseInsensitive ) < 0;
return str1.localeAwareCompare( str2 ) < 0;
}
bool dictLessThan( sptr< Dictionary::Class > const & dict1,
@ -54,7 +54,7 @@ bool dictLessThan( sptr< Dictionary::Class > const & dict1,
return false;
if( !str1.isEmpty() && str2.isEmpty() )
return true;
int res = str1.compare( str2, Qt::CaseInsensitive );
int res = str1.localeAwareCompare( str2 );
if( res )
return res < 0;
@ -64,7 +64,7 @@ bool dictLessThan( sptr< Dictionary::Class > const & dict1,
return false;
if( !str1.isEmpty() && str2.isEmpty() )
return true;
res = str1.compare( str2, Qt::CaseInsensitive );
res = str1.localeAwareCompare( str2 );
if( res )
return res < 0;
@ -75,7 +75,7 @@ bool dictLessThan( sptr< Dictionary::Class > const & dict1,
if( !str1.isEmpty() && str2.isEmpty() )
return true;
return str1.compare( str2, Qt::CaseInsensitive ) < 0;
return str1.localeAwareCompare( str2 ) < 0;
}
} // namespace