]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Some minor corrections (typos, return value handling).
[wxWidgets.git] / src / msw / listctrl.cpp
index 49728549098fe054c85d9e0e213a0a46f1203f8f..ae0826d047045538a753b250063fc06834bf7bea 100644 (file)
@@ -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);
         };
     };