From 4a851b11c2226c769037e5487a878e280f12e3ba Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 4 May 2006 16:19:31 +0000 Subject: [PATCH] made GetRowCount() return size_t to avoid signed/unsigned warnings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/datavgen.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index f3b748fd19..e84b872f4b 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -177,7 +177,7 @@ public: int GetEndOfLastCol(); size_t GetFirstVisibleRow(); size_t GetLastVisibleRow(); - int GetRowCount(); + size_t GetRowCount(); void SelectAllRows( bool on ); void SelectRow( size_t row, bool on ); @@ -1145,7 +1145,7 @@ size_t wxDataViewMainWindow::GetLastVisibleRow() return wxMin( GetRowCount()-1, (client_size.y/m_lineHeight)+1 ); } -int wxDataViewMainWindow::GetRowCount() +size_t wxDataViewMainWindow::GetRowCount() { return GetOwner()->GetModel()->GetNumberOfRows(); } @@ -1159,13 +1159,13 @@ void wxDataViewMainWindow::ChangeCurrentRow( size_t row ) void wxDataViewMainWindow::SelectAllRows( bool on ) { - if (GetRowCount() == 0) return; + if (IsEmpty()) + return; if (on) { m_selection.Clear(); - size_t i; - for (i = 0; i < GetRowCount(); i++) + for (size_t i = 0; i < GetRowCount(); i++) m_selection.Add( i ); Refresh(); } @@ -1278,7 +1278,8 @@ void wxDataViewMainWindow::RefreshRows( size_t from, size_t to ) void wxDataViewMainWindow::RefreshRowsAfter( size_t firstRow ) { size_t count = GetRowCount(); - if (firstRow > count) return; + if (firstRow > count) + return; wxRect rect( 0, firstRow*m_lineHeight, GetEndOfLastCol(), count * m_lineHeight ); m_owner->CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); @@ -1292,7 +1293,7 @@ void wxDataViewMainWindow::RefreshRowsAfter( size_t firstRow ) void wxDataViewMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event) { - wxCHECK_RET( newCurrent < (size_t)GetRowCount(), + wxCHECK_RET( newCurrent < GetRowCount(), _T("invalid item index in OnArrowChar()") ); // if there is no selection, we cannot move it anywhere @@ -1369,7 +1370,7 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event ) break; case WXK_DOWN: - if ( m_currentRow < (size_t)GetRowCount() - 1 ) + if ( m_currentRow < GetRowCount() - 1 ) OnArrowChar( m_currentRow + 1, event ); break; -- 2.45.2