]> git.saurik.com Git - wxWidgets.git/commitdiff
don't paint an infinite number of items if the control is empty
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 26 Apr 2006 00:16:07 +0000 (00:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 26 Apr 2006 00:16:07 +0000 (00:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/vlbox.cpp

index 3bd1a36e9928162a90e64de1d2beba589d49f5c3..4aaf8fa0af0e88d8d6b4586c40757e7c50a2f7fc 100644 (file)
@@ -380,8 +380,8 @@ void wxVListBox::OnPaint(wxPaintEvent& WXUNUSED(event))
     rectLine.width = clientSize.x;
 
     // iterate over all visible lines
-    const size_t lineMax = GetLastVisibleLine();
-    for ( size_t line = GetFirstVisibleLine(); line <= lineMax; line++ )
+    const size_t lineMax = GetVisibleEnd();
+    for ( size_t line = GetFirstVisibleLine(); line < lineMax; line++ )
     {
         const wxCoord hLine = OnGetLineHeight(line);