]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Applied patch [ 1374215 ] Bug fix to wxSpinCtrl for Windows
[wxWidgets.git] / src / msw / listctrl.cpp
index b23125349fb1591bded738bc53b65ef4cd4bc62a..cbedea6f7388219fadaaa102bb6d9e42da8945df 100644 (file)
@@ -24,7 +24,7 @@
     #pragma hdrstop
 #endif
 
-#if wxUSE_LISTCTRL && defined(__WIN95__)
+#if wxUSE_LISTCTRL
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
@@ -371,7 +371,7 @@ bool wxListCtrl::Create(wxWindow *parent,
     if ( InReportView() && wxApp::GetComCtl32Version() >= 470 )
     {
         ::SendMessage(GetHwnd(), LVM_SETEXTENDEDLISTVIEWSTYLE,
-                      0, LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT);
+                      0, LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES);
     }
 
     return true;
@@ -788,12 +788,15 @@ bool wxListCtrl::SetItem(wxListItem& info)
             data->lParam = info.m_data;
 
         // attributes
-        if (info.HasAttributes())
+        if ( info.HasAttributes() )
         {
-            if (data->attr)
-                *data->attr = *info.GetAttributes();
+            const wxListItemAttr& attrNew = *info.GetAttributes();
+
+            // don't overwrite the already set attributes if we have them
+            if ( data->attr )
+                data->attr->AssignFrom(attrNew);
             else
-                data->attr = new wxListItemAttr(*info.GetAttributes());
+                data->attr = new wxListItemAttr(attrNew);
         };
     };
 
@@ -1214,7 +1217,7 @@ void wxListCtrl::SetImageList(wxImageList *imageList, int which)
         m_imageListState = imageList;
         m_ownsImageListState = false;
     }
-    ListView_SetImageList(GetHwnd(), (HIMAGELIST) imageList ? imageList->GetHIMAGELIST() : 0, flags);
+    (void) ListView_SetImageList(GetHwnd(), (HIMAGELIST) imageList ? imageList->GetHIMAGELIST() : 0, flags);
 }
 
 void wxListCtrl::AssignImageList(wxImageList *imageList, int which)
@@ -2766,7 +2769,7 @@ static void wxConvertToMSWListItem(const wxListCtrl *ctrl,
             // pszText is not const, hence the cast
             lvItem.pszText = (wxChar *)info.m_text.c_str();
             if ( lvItem.pszText )
-                lvItem.cchTextMax = info.m_text.Length();
+                lvItem.cchTextMax = info.m_text.length();
             else
                 lvItem.cchTextMax = 0;
         }
@@ -2835,4 +2838,3 @@ static void wxConvertToMSWListCol(int WXUNUSED(col), const wxListItem& item,
 }
 
 #endif // wxUSE_LISTCTRL
-