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,7 +1055,8 @@ void wxGridTableBase::SetRowAttr(wxGridCellAttr *attr, int row)
{
if ( m_attrProvider )
{
attr->SetKind(wxGridCellAttr::Row);
if ( attr )
attr->SetKind(wxGridCellAttr::Row);
m_attrProvider->SetRowAttr(attr, row);
}
else
@@ -1070,7 +1071,8 @@ void wxGridTableBase::SetColAttr(wxGridCellAttr *attr, int col)
{
if ( m_attrProvider )
{
attr->SetKind(wxGridCellAttr::Col);
if ( attr )
attr->SetKind(wxGridCellAttr::Col);
m_attrProvider->SetColAttr(attr, col);
}
else