diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index cce093e378..d78e8997da 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -635,7 +635,12 @@ bool wxListCtrl::SetItem(wxListItem& info) // check whether it has any custom attributes if ( info.HasAttributes() ) { - m_attrs.Put(item.iItem, (wxObject *)new wxListItemAttr(*info.GetAttributes())); + wxListItemAttr *attr; + attr = (wxListItemAttr*) m_attrs.Get(item.iItem); + + if (attr == NULL) + m_attrs.Put(item.iItem, (wxObject *)new wxListItemAttr(*info.GetAttributes())); + else *attr = *info.GetAttributes(); m_hasAnyAttr = TRUE; } @@ -1127,7 +1132,12 @@ long wxListCtrl::InsertItem(wxListItem& info) // check whether it has any custom attributes if ( info.HasAttributes() ) { - m_attrs.Put(item.iItem, (wxObject *)new wxListItemAttr(*info.GetAttributes())); + wxListItemAttr *attr; + attr = (wxListItemAttr*) m_attrs.Get(item.iItem); + + if (attr == NULL) + m_attrs.Put(item.iItem, (wxObject *)new wxListItemAttr(*info.GetAttributes())); + else *attr = *info.GetAttributes(); m_hasAnyAttr = TRUE; }