]> git.saurik.com Git - wxWidgets.git/commitdiff
Avoid the IsVisible assert in GetNextVisible
authorRobin Dunn <robin@alldunn.com>
Mon, 1 Nov 2004 17:55:56 +0000 (17:55 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 1 Nov 2004 17:55:56 +0000 (17:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/src/gizmos/splittree.cpp

index 5f189b2235a08be990d57cb90798d8f6c6f5380a..60f4129f8f210934393eb3ee3250a87b191a0681 100644 (file)
@@ -299,7 +299,9 @@ void wxRemotelyScrolledTreeCtrl::OnPaint(wxPaintEvent& event)
     wxSize clientSize = GetClientSize();
     wxRect itemRect;
     wxTreeItemId h, lastH;
-    for(h=GetFirstVisibleItem();h;h=GetNextVisible(h))
+    for (h=GetFirstVisibleItem();
+         h.IsOk();
+         h=GetNextVisible(h))
     {
         if (GetBoundingRect(h, itemRect))
         {
@@ -307,6 +309,8 @@ void wxRemotelyScrolledTreeCtrl::OnPaint(wxPaintEvent& event)
             dc.DrawLine(0, cy, clientSize.x, cy);
             lastH = h;
         }
+        if (! IsVisible(h))
+            break;
     }
     if (lastH.IsOk() && GetBoundingRect(lastH, itemRect))
     {
@@ -508,7 +512,9 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
     wxSize clientSize = GetClientSize();
     wxRect itemRect;
     wxTreeItemId h, lastH;
-    for(h=m_treeCtrl->GetFirstVisibleItem();h;h=m_treeCtrl->GetNextVisible(h))
+    for (h=m_treeCtrl->GetFirstVisibleItem();
+         h.IsOk();
+         h=m_treeCtrl->GetNextVisible(h))
     {
         if (m_treeCtrl->GetBoundingRect(h, itemRect))
         {
@@ -521,6 +527,8 @@ void wxTreeCompanionWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
             DrawItem(dc, h, drawItemRect);
             dc.DrawLine(0, cy, clientSize.x, cy);
         }
+        if (! m_treeCtrl->IsVisible(h))
+            break;
     }
     if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect))
     {