diff --git a/checkin_notes b/checkin_notes index 0667af2372..7738b2b162 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7563,3 +7563,11 @@ David 28 July 2007 client/ client_types.h cs_scheduler.C + +Charlie 30 July 2007 + - Manager: don't call GetWorkCount() repeatedly in CViewTransfersGrid + and CViewMessagesGrid. + + clientgui/ + ViewMessagesGrid.cpp + ViewTransfersGrid.cpp diff --git a/clientgui/ViewMessagesGrid.cpp b/clientgui/ViewMessagesGrid.cpp index 8c271c273c..b61e0d49ec 100644 --- a/clientgui/ViewMessagesGrid.cpp +++ b/clientgui/ViewMessagesGrid.cpp @@ -272,11 +272,12 @@ bool CViewMessagesGrid::OnRestoreState(wxConfigBase* pConfig) { } void CViewMessagesGrid::OnListRender (wxTimerEvent& WXUNUSED(event)) { + wxInt32 docCount = GetDocCount(); wxASSERT(m_pGridPane); // We haven't connected up to the CC yet, there is nothing to display, make sure // everything is deleted. - if ( GetDocCount() <= 0 ) { + if ( docCount <= 0 ) { if ( m_pGridPane->GetNumberRows() ) { m_pGridPane->DeleteRows(0, m_pGridPane->GetNumberRows()); } @@ -285,13 +286,13 @@ void CViewMessagesGrid::OnListRender (wxTimerEvent& WXUNUSED(event)) { // Right-size the grid so that the number of rows matches // the document state. - if(GetDocCount() != m_pGridPane->GetNumberRows()) { - if (GetDocCount() > m_pGridPane->GetNumberRows()) { - m_pGridPane->AppendRows(GetDocCount() - m_pGridPane->GetNumberRows()); + if(docCount != m_pGridPane->GetNumberRows()) { + if (docCount > m_pGridPane->GetNumberRows()) { + m_pGridPane->AppendRows(docCount - m_pGridPane->GetNumberRows()); } else { - m_pGridPane->DeleteRows(0, m_pGridPane->GetNumberRows() - GetDocCount()); + m_pGridPane->DeleteRows(0, m_pGridPane->GetNumberRows() - docCount); } - wxASSERT(GetDocCount() == m_pGridPane->GetNumberRows()); + wxASSERT(docCount == m_pGridPane->GetNumberRows()); } //update cell values (unsorted, like delivered from core client) diff --git a/clientgui/ViewTransfersGrid.cpp b/clientgui/ViewTransfersGrid.cpp index 37ba28463e..4deb969326 100644 --- a/clientgui/ViewTransfersGrid.cpp +++ b/clientgui/ViewTransfersGrid.cpp @@ -468,10 +468,11 @@ bool CViewTransfersGrid::OnRestoreState(wxConfigBase* pConfig) { } void CViewTransfersGrid::OnListRender( wxTimerEvent& WXUNUSED(event) ) { + wxInt32 docCount = GetDocCount(); // We haven't connected up to the CC yet, there is nothing to display, make sure // everything is deleted. - if ( GetDocCount() <= 0 ) { + if ( docCount <= 0 ) { if ( m_pGridPane->GetNumberRows() ) { m_pGridPane->DeleteRows(0, m_pGridPane->GetNumberRows()); } @@ -480,13 +481,13 @@ void CViewTransfersGrid::OnListRender( wxTimerEvent& WXUNUSED(event) ) { // Right-size the grid so that the number of rows matches // the document state. - if(GetDocCount() != m_pGridPane->GetNumberRows()) { - if (GetDocCount() > m_pGridPane->GetNumberRows()) { - m_pGridPane->AppendRows(GetDocCount() - m_pGridPane->GetNumberRows()); + if(docCount != m_pGridPane->GetNumberRows()) { + if (docCount > m_pGridPane->GetNumberRows()) { + m_pGridPane->AppendRows(docCount - m_pGridPane->GetNumberRows()); } else { - m_pGridPane->DeleteRows(0, m_pGridPane->GetNumberRows() - GetDocCount()); + m_pGridPane->DeleteRows(0, m_pGridPane->GetNumberRows() - docCount); } - wxASSERT(GetDocCount() == m_pGridPane->GetNumberRows()); + wxASSERT(docCount == m_pGridPane->GetNumberRows()); } //update cell values