]> git.saurik.com Git - wxWidgets.git/commitdiff
don't overwrite the existing attributes when setting one new one, i.e. SetItemBackgro...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Dec 2005 03:07:48 +0000 (03:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Dec 2005 03:07:48 +0000 (03:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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);
         };
     };