Fixed problems with reassigning the already assigned attribute, see #9567.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2008-06-15 17:24:22 +00:00
parent 711335e205
commit d1b021ffb9

View File

@@ -83,10 +83,12 @@ struct wxGridCellWithAttr
wxGridCellWithAttr& operator=(const wxGridCellWithAttr& other)
{
coords = other.coords;
attr->DecRef();
attr = other.attr;
attr->IncRef();
if (attr != other.attr)
{
attr->DecRef();
attr = other.attr;
attr->IncRef();
}
return *this;
}
@@ -2766,6 +2768,9 @@ void wxGridRowOrColAttrData::SetAttr(wxGridCellAttr *attr, int rowOrCol)
else
{
size_t n = (size_t)i;
if ( m_attrs[n] == attr )
// nothing to do
return;
if ( attr )
{
// change the attribute