wxUniv compilation fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-07-10 12:25:46 +00:00
parent 7c36b6a2a1
commit 6522713c75
37 changed files with 170 additions and 147 deletions

View File

@@ -4027,17 +4027,24 @@ void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to)
if ( m_lineFrom == (size_t)-1 )
{
m_lineFrom = GetScrollPos(wxVERTICAL);
size_t count = GetItemCount();
if ( count )
{
m_lineFrom = GetScrollPos(wxVERTICAL);
wxASSERT_MSG( m_lineFrom < count, _T("invalid scroll position?") );
wxASSERT_MSG( m_lineFrom < count, _T("invalid scroll position?") );
// we redraw one extra line but this is needed to make the redrawing
// logic work when there is a fractional number of lines on screen
m_lineTo = m_lineFrom + m_linesPerPage;
if ( m_lineTo >= count )
m_lineTo = count - 1;
// we redraw one extra line but this is needed to make the redrawing
// logic work when there is a fractional number of lines on screen
m_lineTo = m_lineFrom + m_linesPerPage;
if ( m_lineTo >= count )
m_lineTo = count - 1;
}
else // empty control
{
m_lineFrom = 0;
m_lineTo = (size_t)-1;
}
}
wxASSERT_MSG( m_lineFrom <= m_lineTo && m_lineTo < GetItemCount(),