]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed apparent typo in wxGridCellAttr::MergeWith, hopefully fixing
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 1 Sep 2002 18:14:31 +0000 (18:14 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 1 Sep 2002 18:14:31 +0000 (18:14 +0000)
        bug 581558 (wxGrid.SetColAttr vs. SetCellAlignment)
Remove editor in Redimension. This should fix
        bug 593189 (wxGrid:delting rows doesn't hide editor)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 07d02c8dd4b27085b2d2c0d21fe67639db0ac9cc..f9ff98782805cdb2f0b0c4b335744acdc7c44438 100644 (file)
@@ -1953,7 +1953,7 @@ void wxGridCellAttr::MergeWith(wxGridCellAttr *mergefrom)
         SetBackgroundColour(mergefrom->GetBackgroundColour());
     if ( !HasFont() && mergefrom->HasFont() )
         SetFont(mergefrom->GetFont());
-    if ( !!HasAlignment() && mergefrom->HasAlignment() ){
+    if ( !HasAlignment() && mergefrom->HasAlignment() ){
         int hAlign, vAlign;
         mergefrom->GetAlignment( &hAlign, &vAlign);
         SetAlignment(hAlign, vAlign);
@@ -3997,6 +3997,12 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
     // Clear the attribute cache as the attribute might refer to a different
     // cell than stored in the cache after adding/removing rows/columns.
     ClearAttrCache();
+    // By the same reasoning, the editor should be dismissed if columns are
+    // added or removed. And for consistency, it should IMHO always be
+    // removed, not only if the cell "underneath" it actually changes.
+    // For now, I intentionally do not save the editor's content as the
+    // cell it might want to save that stuff to might no longer exist.
+    DisableCellEditControl();
 #if 0
     // if we were using the default widths/heights so far, we must change them
     // now