Add nullptr checks to wxGridTableBase::Set(Row|Col)Attr

wxGridTableBase::SetAttr (for cells) does check its attr parameter for
nullptr, but the check was missing from the row and column functions.
Adding it makes it possible to use a nullptr argument to reset the
attributes.
This commit is contained in:
bogiord
2016-01-18 17:13:38 +02:00
committed by Vadim Zeitlin
parent 183a88062a
commit e7fa9b0c10

View File

@@ -1055,6 +1055,7 @@ void wxGridTableBase::SetRowAttr(wxGridCellAttr *attr, int row)
{ {
if ( m_attrProvider ) if ( m_attrProvider )
{ {
if ( attr )
attr->SetKind(wxGridCellAttr::Row); attr->SetKind(wxGridCellAttr::Row);
m_attrProvider->SetRowAttr(attr, row); m_attrProvider->SetRowAttr(attr, row);
} }
@@ -1070,6 +1071,7 @@ void wxGridTableBase::SetColAttr(wxGridCellAttr *attr, int col)
{ {
if ( m_attrProvider ) if ( m_attrProvider )
{ {
if ( attr )
attr->SetKind(wxGridCellAttr::Col); attr->SetKind(wxGridCellAttr::Col);
m_attrProvider->SetColAttr(attr, col); m_attrProvider->SetColAttr(attr, col);
} }