]> git.saurik.com Git - wxWidgets.git/commitdiff
don't store NULL attribute in wxGridRowOrColAttrData::SetAttr() unnecessarily
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 21 Oct 2007 21:27:56 +0000 (21:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 21 Oct 2007 21:27:56 +0000 (21:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 47fc186875cd1bfe75bf5a38a5d299d0d11fb308..0c7b85e417e96b5309db9c3cdcd254ff5f7b61e3 100644 (file)
@@ -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
     {