From 2bd6903d18409a4bac4bb0b44049939b86658192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 18 Sep 2000 20:10:34 +0000 Subject: [PATCH] backmerged fix in wxListCtrl::SetItem and InsertItem -- changing attributes more than once had no effect git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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; }