]> git.saurik.com Git - wxWidgets.git/commitdiff
Clear attribute cache in Redimension to fix Bug 508407.
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 1 Sep 2002 16:34:17 +0000 (16:34 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 1 Sep 2002 16:34:17 +0000 (16:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp
src/generic/gridg.cpp

index dc65ee909e56580349755d8d4335fb74c31d60db..07d02c8dd4b27085b2d2c0d21fe67639db0ac9cc 100644 (file)
@@ -3994,6 +3994,9 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
     int i;
     bool result = FALSE;
 
+    // Clear the attribute cache as the attribute might refer to a different
+    // cell than stored in the cache after adding/removing rows/columns.
+    ClearAttrCache();
 #if 0
     // if we were using the default widths/heights so far, we must change them
     // now
index 9de3b1897aff15e5bda588a991056ae468525bf1..9611d4f61ff8dff4a6cafc89e170cf57edb35b5e 100644 (file)
@@ -1538,7 +1538,7 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col)
           HighlightCell(dc, TRUE);
 #endif
     }
-  else
+  else if (!wxIPE_HIGHLIGHT)
     {
       // 1) Why isn't this needed for Windows??
       // Probably because of the SetValue?? JS.
@@ -1547,10 +1547,11 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col)
       //
       // 3) It *is* needed for Motif - michael
       //
-#if defined(__WXMOTIF__)
-      if ((wxIPE_HIGHLIGHT || !(m_editable && m_editInPlace)))
+      // 4) It *seems* to be needed whenever
+      //    wxIPE_HIGHLIGHT is not set (i.e.
+      //    for both wxGTK and wxMOTIF)... SN.
+      if (!(m_editable && m_editInPlace)))
           HighlightCell(dc, TRUE);
-#endif
     }
 
   dc->DestroyClippingRegion();