From b90a74f6fe80f6137e8601ba9f49ae12f9be8e4e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 17 Apr 2020 23:28:32 +0200 Subject: [PATCH] Minor formatting and code style fixes Put braces around loop body. Use const for local variables. No real changes. --- src/generic/datavgen.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 97038b4525..62c1cbe189 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -914,8 +914,8 @@ private: bool IsItemSingleValued(const wxDataViewItem& item) const { bool hadColumnWithValue = false; - unsigned int cols = GetOwner()->GetColumnCount(); - const wxDataViewModel* model = GetModel(); + const unsigned int cols = GetOwner()->GetColumnCount(); + const wxDataViewModel* const model = GetModel(); for ( unsigned int i = 0; i < cols; i++ ) { if ( model->HasValue(item, i) ) @@ -929,14 +929,17 @@ private: return true; } - // find first column with value - wxDataViewColumn * FindFirstColumnWithValue(const wxDataViewItem& item) const + // Find the first column with a value in it. + wxDataViewColumn* FindFirstColumnWithValue(const wxDataViewItem& item) const { - unsigned int cols = GetOwner()->GetColumnCount(); - const wxDataViewModel* model = GetModel(); - for ( unsigned int i ; i < cols; i++ ) + const unsigned int cols = GetOwner()->GetColumnCount(); + const wxDataViewModel* const model = GetModel(); + for ( unsigned int i = 0; i < cols; i++ ) + { if ( model->HasValue(item, i) ) return GetOwner()->GetColumnAt(i); + } + return NULL; } @@ -4549,7 +4552,7 @@ bool wxDataViewMainWindow::TryAdvanceCurrentColumn(wxDataViewTreeNode *node, wxK } int idx = GetOwner()->GetColumnIndex(m_currentCol); - unsigned int cols = GetOwner()->GetColumnCount(); + const unsigned int cols = GetOwner()->GetColumnCount(); for ( unsigned int i = 0; i < cols; i++ ) { idx += (forward ? +1 : -1);