From 35ec54d3c5e64c8c479192cf53bf75897afc923c Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 23 Aug 2000 10:39:33 +0000 Subject: [PATCH] fixed my previous fix in wxListCtrl::SetItem git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 1481cda78c..8d58bde1da 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -632,8 +632,11 @@ bool wxListCtrl::SetItem(wxListItem& info) // check whether it has any custom attributes if ( info.HasAttributes() ) { - delete m_attrs.Delete(item.iItem); // remove existing attributes - 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; } @@ -1125,7 +1128,11 @@ 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; } -- 2.45.2