From 71c9ea2b9e06a5f1bda1bf8df2410bc9152f9f04 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 1 Nov 2004 17:55:56 +0000 Subject: [PATCH] Avoid the IsVisible assert in GetNextVisible git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/gizmos/splittree.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/contrib/src/gizmos/splittree.cpp b/contrib/src/gizmos/splittree.cpp index 5f189b2235..60f4129f8f 100644 --- a/contrib/src/gizmos/splittree.cpp +++ b/contrib/src/gizmos/splittree.cpp @@ -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)) { -- 2.45.2