Use standard naming convention for RowToTreeNodeJob members

Prefix them with "m_" to indicate that they're member variables.

No real changes.
This commit is contained in:
Vadim Zeitlin
2018-11-04 14:54:53 +01:00
parent fe865a1743
commit 05ae63e40a

View File

@@ -3468,31 +3468,28 @@ int wxDataViewMainWindow::GetLineHeight( unsigned int row ) const
class RowToTreeNodeJob: public DoJob class RowToTreeNodeJob: public DoJob
{ {
public: public:
RowToTreeNodeJob( unsigned int row_ , int current_, wxDataViewTreeNode * node ) RowToTreeNodeJob(unsigned int row, int current, wxDataViewTreeNode *parent)
: m_row(row), m_current(current), m_parent(parent), m_ret(NULL)
{ {
this->row = row_;
this->current = current_;
ret = NULL;
parent = node;
} }
virtual int operator() ( wxDataViewTreeNode * node ) wxOVERRIDE virtual int operator() ( wxDataViewTreeNode * node ) wxOVERRIDE
{ {
current ++; m_current ++;
if( current == static_cast<int>(row)) if( m_current == static_cast<int>(m_row))
{ {
ret = node; m_ret = node;
return DoJob::DONE; return DoJob::DONE;
} }
if( node->GetSubTreeCount() + current < static_cast<int>(row) ) if( node->GetSubTreeCount() + m_current < static_cast<int>(m_row) )
{ {
current += node->GetSubTreeCount(); m_current += node->GetSubTreeCount();
return DoJob::SKIP_SUBTREE; return DoJob::SKIP_SUBTREE;
} }
else else
{ {
parent = node; m_parent = node;
// If the current node has only leaf children, we can find the // If the current node has only leaf children, we can find the
// desired node directly. This can speed up finding the node // desired node directly. This can speed up finding the node
@@ -3500,8 +3497,8 @@ public:
if ( node->HasChildren() && if ( node->HasChildren() &&
(int)node->GetChildNodes().size() == node->GetSubTreeCount() ) (int)node->GetChildNodes().size() == node->GetSubTreeCount() )
{ {
const int index = static_cast<int>(row) - current - 1; const int index = static_cast<int>(m_row) - m_current - 1;
ret = node->GetChildNodes()[index]; m_ret = node->GetChildNodes()[index];
return DoJob::DONE; return DoJob::DONE;
} }
@@ -3510,13 +3507,13 @@ public:
} }
wxDataViewTreeNode * GetResult() const wxDataViewTreeNode * GetResult() const
{ return ret; } { return m_ret; }
private: private:
unsigned int row; unsigned int m_row;
int current; int m_current;
wxDataViewTreeNode * ret; wxDataViewTreeNode* m_parent;
wxDataViewTreeNode * parent; wxDataViewTreeNode* m_ret;
}; };
wxDataViewTreeNode * wxDataViewMainWindow::GetTreeNodeByRow(unsigned int row) const wxDataViewTreeNode * wxDataViewMainWindow::GetTreeNodeByRow(unsigned int row) const