]> git.saurik.com Git - wxWidgets.git/commitdiff
don't access inexistent column in wxDataViewTreeCtrl::OnSize() (this bug also probabl...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 8 Dec 2008 13:25:09 +0000 (13:25 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 8 Dec 2008 13:25:09 +0000 (13:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/datavcmn.cpp

index 26d568cd34ebbe0b1081ebb583ac27568ab18bae..34e2123b6c3ac89411baf6c2c50c3b341d0ddaa2 100644 (file)
@@ -1887,10 +1887,12 @@ void wxDataViewTreeCtrl::OnCollapsed( wxDataViewEvent &event )
 void wxDataViewTreeCtrl::OnSize( wxSizeEvent &event )
 {
 #if defined(wxUSE_GENERICDATAVIEWCTRL)
-    wxSize size = GetClientSize();
-    wxDataViewColumn *col = GetColumn( 0 );
-    if (col)
-       col->SetWidth( size.x );
+    // automatically resize our only column to take the entire control width
+    if ( GetColumnCount() )
+    {
+        wxSize size = GetClientSize();
+        GetColumn(0)->SetWidth(size.x);
+    }
 #endif
     event.Skip( true );
 }