Don't call wxVariant::MakeNull() unnecessary
Simplify recently added code in wxDataViewModel::Compare(). No real changes.
This commit is contained in:
@@ -334,8 +334,13 @@ int wxDataViewModel::Compare( const wxDataViewItem &item1, const wxDataViewItem
|
|||||||
unsigned int column, bool ascending ) const
|
unsigned int column, bool ascending ) const
|
||||||
{
|
{
|
||||||
wxVariant value1,value2;
|
wxVariant value1,value2;
|
||||||
HasValue(item1, column) ? GetValue( value1, item1, column ) : value1.MakeNull();
|
|
||||||
HasValue(item2, column) ? GetValue( value2, item2, column ) : value2.MakeNull();
|
// Avoid calling GetValue() for the cells that are not supposed to have any
|
||||||
|
// value, this might be unexpected.
|
||||||
|
if ( HasValue(item1, column) )
|
||||||
|
GetValue( value1, item1, column );
|
||||||
|
if ( HasValue(item2, column) )
|
||||||
|
GetValue( value2, item2, column );
|
||||||
|
|
||||||
if (!ascending)
|
if (!ascending)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user