X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c25f61f16abe18f91e5684964ea3d9e638043a69..94e2ed3b8db0220160c0b939782cd46914ec073a:/src/generic/listctrl.cpp?ds=inline diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 41a18077cd..e4fc11143e 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2417,6 +2417,12 @@ bool wxListMainWindow::HighlightLine( size_t line, bool highlight ) void wxListMainWindow::RefreshLine( size_t line ) { + size_t visibleFrom, visibleTo; + GetVisibleLinesRange(&visibleFrom, &visibleTo); + + if ( line < visibleFrom || line > visibleTo ) + return; + wxRect rect = GetLineRect(line); CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); @@ -2656,7 +2662,11 @@ void wxListMainWindow::SendNotify( size_t line, if ( point != wxDefaultPosition ) le.m_pointDrag = point; - if ( command != wxEVT_COMMAND_LIST_DELETE_ITEM ) + // don't try to get the line info for virtual list controls: the main + // program has it anyhow and if we did it would result in accessing all + // the lines, even those which are not visible now and this is precisely + // what we're trying to avoid + if ( !IsVirtual() && (command != wxEVT_COMMAND_LIST_DELETE_ITEM) ) { GetLine(line)->GetItem( 0, le.m_item ); }