Use symbolic constants instead of magic numbers in wxDataViewCtrl code.
No real changes, just add SortColumn_XXX symbolic constants which are somewhat more clear than -1 and -2 used before. Although the code based on the global variables remains as bad as before. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -80,7 +80,19 @@ static const int EXPANDER_OFFSET = 1;
|
|||||||
// For the generic implementation, both the leaf nodes and the nodes are sorted for
|
// For the generic implementation, both the leaf nodes and the nodes are sorted for
|
||||||
// fast search when needed
|
// fast search when needed
|
||||||
static wxDataViewModel* g_model;
|
static wxDataViewModel* g_model;
|
||||||
static int g_column = -2;
|
|
||||||
|
// The column is either the index of the column to be used for sorting or one
|
||||||
|
// of the special values in this enum:
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
// Don't sort at all.
|
||||||
|
SortColumn_None = -2,
|
||||||
|
|
||||||
|
// Sort using the model default sort order.
|
||||||
|
SortColumn_Default = -1
|
||||||
|
};
|
||||||
|
|
||||||
|
static int g_column = SortColumn_None;
|
||||||
static bool g_asending = true;
|
static bool g_asending = true;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -588,9 +600,9 @@ public:
|
|||||||
if( !col )
|
if( !col )
|
||||||
{
|
{
|
||||||
if (g_model->HasDefaultCompare())
|
if (g_model->HasDefaultCompare())
|
||||||
g_column = -1;
|
g_column = SortColumn_Default;
|
||||||
else
|
else
|
||||||
g_column = -2;
|
g_column = SortColumn_None;
|
||||||
|
|
||||||
g_asending = true;
|
g_asending = true;
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user