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:
parent
525fd27d24
commit
35ec54d3c5
@ -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;
|
||||||
m_attrs.Put(item.iItem, (wxObject *)new wxListItemAttr(*info.GetAttributes()));
|
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;
|
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() )
|
||||||
{
|
{
|
||||||
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;
|
m_hasAnyAttr = TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user