From: Robin Dunn <robin@alldunn.com>
Date: Tue, 14 Aug 2001 18:48:37 +0000 (+0000)
Subject: Fixed the drawing of the HRules so they don't try to iterate over all
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6443de026310552cacd68a6d0318e73d14929680

Fixed the drawing of the HRules so they don't try to iterate over all
the zillions of items in a large (or virtual) list control


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp
index 4f3ed90f60..156485d6d5 100644
--- a/src/msw/listctrl.cpp
+++ b/src/msw/listctrl.cpp
@@ -1906,7 +1906,8 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
     int i;
     if (drawHRules)
     {
-        for (i = 0; i < itemCount; i++)
+        long top = GetTopItem();
+        for (i = top; i < top + GetCountPerPage() + 1; i++)
         {
             if (GetItemRect(i, itemRect))
             {