From 21dfbb75af5b8763f0e3d6a9d1a1b2d5b250c37f Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 15 Feb 2013 20:29:37 -0800 Subject: [PATCH] MGR: Make my recent Event Log changes a little more robust --- clientgui/DlgEventLog.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index d3ec54eb1e..148b9c2866 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -447,7 +447,12 @@ wxInt32 CDlgEventLog::GetFilteredMessageIndex( wxInt32 iRow) const { } -// Get the (possibly filtered) item count (i.e., the Row count) +// NOTE: this function is designed to be called only +// from CDlgEventLog::OnRefresh(). If you need to call it +// from other routines, it will need modification. +// +// Get the (possibly filtered) item count (i.e., the Row count) and +// make any needed adjustments if oldest items have been deleted. wxInt32 CDlgEventLog::GetDocCount() { int i, j, numDeletedRows; CMainDocument* pDoc = wxGetApp().GetDocument(); @@ -463,6 +468,7 @@ wxInt32 CDlgEventLog::GetDocCount() { } numDeletedRows = pDoc->GetFirstMsgSeqNum() - m_iPreviousFirstMsgSeqNum; + if (numDeletedRows < 0) numDeletedRows = 0; m_iNumDeletedFilteredRows = 0; if (s_bIsFiltered) {