fixed my previous fix in wxListCtrl::SetItem

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2000-08-23 10:39:33 +00:00
parent 525fd27d24
commit 35ec54d3c5

View File

@ -632,8 +632,11 @@ bool wxListCtrl::SetItem(wxListItem& info)
// check whether it has any custom attributes // check whether it has any custom attributes
if ( info.HasAttributes() ) if ( info.HasAttributes() )
{ {
delete m_attrs.Delete(item.iItem); // remove existing attributes wxListItemAttr *attr;
attr = (wxListItemAttr*) m_attrs.Get(item.iItem);
if (attr == NULL)
m_attrs.Put(item.iItem, (wxObject *)new wxListItemAttr(*info.GetAttributes())); m_attrs.Put(item.iItem, (wxObject *)new wxListItemAttr(*info.GetAttributes()));
else *attr = *info.GetAttributes();
m_hasAnyAttr = TRUE; m_hasAnyAttr = TRUE;
} }
@ -1125,7 +1128,11 @@ long wxListCtrl::InsertItem(wxListItem& info)
// check whether it has any custom attributes // check whether it has any custom attributes
if ( info.HasAttributes() ) if ( info.HasAttributes() )
{ {
wxListItemAttr *attr;
attr = (wxListItemAttr*) m_attrs.Get(item.iItem);
if (attr == NULL)
m_attrs.Put(item.iItem, (wxObject *)new wxListItemAttr(*info.GetAttributes())); m_attrs.Put(item.iItem, (wxObject *)new wxListItemAttr(*info.GetAttributes()));
else *attr = *info.GetAttributes();
m_hasAnyAttr = TRUE; m_hasAnyAttr = TRUE;
} }