From: Václav Slavík Date: Sat, 22 Jan 2011 19:02:02 +0000 (+0000) Subject: wxDataViewCtrl: fix autosized columns recalculation. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3d825e061318925b0b72c535d2b63ec5910829e4?ds=inline wxDataViewCtrl: fix autosized columns recalculation. The code and its assumptions were correct only for generic wxHeaderCtrl, it didn't work for MSW implementation. Fixed by updating all columns every time. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66729 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 2531bad861..45395280f2 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4325,8 +4325,9 @@ void wxDataViewCtrl::InvalidateColBestWidths() if ( m_headerArea ) { - // this updates visual appearance of columns 0 and up, not just 0 - m_headerArea->UpdateColumn(0); + const unsigned cols = m_headerArea->GetColumnCount(); + for ( unsigned i = 0; i < cols; i++ ) + m_headerArea->UpdateColumn(i); } }