From 62d249cb22b95c846afdce4d3a0cd1a63a1672b8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 21 Oct 2007 21:27:56 +0000 Subject: [PATCH] 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 --- src/generic/grid.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 47fc186875..0c7b85e417 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -2751,9 +2751,13 @@ void wxGridRowOrColAttrData::SetAttr(wxGridCellAttr *attr, int rowOrCol) int i = m_rowsOrCols.Index(rowOrCol); if ( i == wxNOT_FOUND ) { - // add the attribute - m_rowsOrCols.Add(rowOrCol); - m_attrs.Add(attr); + if ( attr ) + { + // add the attribute + m_rowsOrCols.Add(rowOrCol); + m_attrs.Add(attr); + } + // nothing to remove } else { -- 2.45.2