From 1cb66f1c8b7728d18d71571c0f8304b3b68d96bc Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 17 Jul 2007 11:14:03 +0000 Subject: [PATCH] MGR ViewTaskGrid: Force full refresh only if sort order has changed svn path=/trunk/boinc/; revision=13169 --- clientgui/ViewWorkGrid.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/clientgui/ViewWorkGrid.cpp b/clientgui/ViewWorkGrid.cpp index b655fc8668..3c309ee761 100644 --- a/clientgui/ViewWorkGrid.cpp +++ b/clientgui/ViewWorkGrid.cpp @@ -914,9 +914,20 @@ void CViewWorkGrid::OnListRender( wxTimerEvent& WXUNUSED(event) ) { (arrColumnDataChanged[m_pGridPane->sortColumn]==1) || m_pGridPane->sortNeededByLabelClick) { + wxArrayString ordered_indexes; + for(int iRow = 0; iRow < iMax; iRow++) { + ordered_indexes.Add(m_pGridPane->GetCellValue(iRow, COLUMN_RESULTS_INDEX)); + } + m_pGridPane->SortData(); - // Refresh Grid - m_pGridPane->ForceRefresh(); + + for(int iRow = 0; iRow < iMax; iRow++) { + if (ordered_indexes[iRow] != m_pGridPane->GetCellValue(iRow, COLUMN_RESULTS_INDEX)) { + // Refresh entire grid if sort order has changed + m_pGridPane->ForceRefresh(); + break; + } + } } UpdateSelection(); }