]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't generate wxEVT_COMMAND_DATAVIEW_CACHE_HINT for empty control.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 23 Apr 2011 18:01:36 +0000 (18:01 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 23 Apr 2011 18:01:36 +0000 (18:01 +0000)
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

index b2b2c6374d967d7ca6f58861ac0eed415ef97dcb..97a61a73477074e31ae9c9056682391a47c8824a 100644 (file)
@@ -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() );