]> git.saurik.com Git - wxWidgets.git/commitdiff
Avoid nested DC assert
authorRobin Dunn <robin@alldunn.com>
Sat, 21 Oct 2006 01:17:21 +0000 (01:17 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 21 Oct 2006 01:17:21 +0000 (01:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42184 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index eea37b0384f24d4af3a97d0f04fef0d60b75322f..42db9247e595a0283559b53bdfc66085873c7cfe 100644 (file)
@@ -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