X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/625cb8c0b1ac12f26265cae2c69d7f510de0edb1..9cf99fc093f9c45b6b5d8d8b357699d826c9916a:/src/msw/listctrl.cpp?ds=inline diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 4f3ed90f60..1196685fe8 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)) { @@ -1916,7 +1917,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) dc.DrawLine(0, cy, clientSize.x, cy); } // Draw last line - if (i == (GetItemCount() - 1)) + if (i == itemCount - 1) { cy = itemRect.GetBottom(); dc.DrawLine(0, cy, clientSize.x, cy); @@ -1924,7 +1925,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) } } } - i = (GetItemCount() - 1); + i = itemCount - 1; if (drawVRules && (i > -1)) { wxRect firstItemRect;