]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed problems with reassigning the already assigned attribute, see #9567.
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 15 Jun 2008 17:24:22 +0000 (17:24 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 15 Jun 2008 17:24:22 +0000 (17:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index def8868c2ef95bcacfde4896a434a0e310d8c69c..e021e6b92dc3a79463f8899c977be5fedb6d9c26 100644 (file)
@@ -83,10 +83,12 @@ struct wxGridCellWithAttr
     wxGridCellWithAttr& operator=(const wxGridCellWithAttr& other)
     {
         coords = other.coords;
-        attr->DecRef();
-        attr = other.attr;
-        attr->IncRef();
-
+        if (attr != other.attr)
+        {
+            attr->DecRef();
+            attr = other.attr;
+            attr->IncRef();
+        }
         return *this;
     }
 
@@ -2766,6 +2768,9 @@ void wxGridRowOrColAttrData::SetAttr(wxGridCellAttr *attr, int rowOrCol)
     else
     {
         size_t n = (size_t)i;
+        if ( m_attrs[n] == attr )
+            // nothing to do
+            return; 
         if ( attr )
         {
             // change the attribute