]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for visible lines calculation
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Jul 2001 12:45:47 +0000 (12:45 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Jul 2001 12:45:47 +0000 (12:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10937 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index aa69f008cee3f6781302648bfa9d461d0a02eaa0..8ccd9c7798e19cbf605977f0190b10e2c4fd42aa 100644 (file)
@@ -4032,7 +4032,9 @@ void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to)
         {
             m_lineFrom = GetScrollPos(wxVERTICAL);
 
-            wxASSERT_MSG( m_lineFrom < count, _T("invalid scroll position?") );
+            // this may happen if SetScrollbars() hadn't been called yet
+            if ( m_lineFrom >= count )
+                m_lineFrom = count;
 
             // 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