diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index eea37b0384..42db9247e5 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -3946,6 +3946,8 @@ bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos) const void wxListMainWindow::RecalculatePositions(bool noRefresh) { + const int lineHeight = GetLineHeight(); + wxClientDC dc( this ); dc.SetFont( GetFont() ); @@ -3979,8 +3981,6 @@ void wxListMainWindow::RecalculatePositions(bool noRefresh) clientHeight; GetSize( &clientWidth, &clientHeight ); - const int lineHeight = GetLineHeight(); - if ( InReportView() ) { // all lines have the same height and we scroll one line per step