don't store NULL attribute in wxGridRowOrColAttrData::SetAttr() unnecessarily

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-10-21 21:27:56 +00:00
parent 065ae02d48
commit 62d249cb22

View File

@@ -2750,11 +2750,15 @@ void wxGridRowOrColAttrData::SetAttr(wxGridCellAttr *attr, int rowOrCol)
{ {
int i = m_rowsOrCols.Index(rowOrCol); int i = m_rowsOrCols.Index(rowOrCol);
if ( i == wxNOT_FOUND ) if ( i == wxNOT_FOUND )
{
if ( attr )
{ {
// add the attribute // add the attribute
m_rowsOrCols.Add(rowOrCol); m_rowsOrCols.Add(rowOrCol);
m_attrs.Add(attr); m_attrs.Add(attr);
} }
// nothing to remove
}
else else
{ {
size_t n = (size_t)i; size_t n = (size_t)i;