]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Warning fix.
[wxWidgets.git] / src / generic / listctrl.cpp
index 952596d171056f39d8d1a9a3fea83d843c1baa11..42db9247e595a0283559b53bdfc66085873c7cfe 100644 (file)
@@ -39,6 +39,7 @@
     #include "wx/timer.h"
     #include "wx/settings.h"
     #include "wx/dynarray.h"
+    #include "wx/dcclient.h"
     #include "wx/dcscreen.h"
     #include "wx/math.h"
 #endif
@@ -887,7 +888,7 @@ void wxListItemData::SetItem( const wxListItem &info )
     if ( info.HasAttributes() )
     {
         if ( m_attr )
-            *m_attr = *info.GetAttributes();
+            m_attr->AssignFrom(*info.GetAttributes());
         else
             m_attr = new wxListItemAttr(*info.GetAttributes());
     }
@@ -3945,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() );
 
@@ -3978,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