From da87ce5a36c80e5e049bb8a35c29c4990064206b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 23 Apr 2011 18:01:36 +0000 Subject: [PATCH] Don't generate wxEVT_COMMAND_DATAVIEW_CACHE_HINT for empty control. Don't send any cache hint events for empty wxDataViewCtrl. Sending them was unnecessary, inconsistent with wxListCtrl (which doesn't send them when it's empty) and the events also had incorrect range. Just don't create them at all to avoid all these problems at once. Closes #13132. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/datavgen.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index b2b2c6374d..97a61a7347 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -1597,6 +1597,12 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.DrawRectangle(GetClientSize()); #endif + if ( IsEmpty() ) + { + // No items to draw. + return; + } + // prepare the DC GetOwner()->PrepareDC( dc ); dc.SetFont( GetFont() ); -- 2.50.0