From: Roger Gammans <rgammans@computer-surgery.co.uk>
Date: Sun, 18 May 2003 20:15:17 +0000 (+0000)
Subject:  * Prevent miminum and actual row and col sizes going below the
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b4bfd0fa637e9166712cc461f43bb804f751b0c7

 * Prevent miminum and actual row and col sizes going below the
   minimum acceptable row size.
   This should fix sf.net bug #645734


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

diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp
index 6841247663..ef6fddb7e0 100644
--- a/src/generic/grid.cpp
+++ b/src/generic/grid.cpp
@@ -9269,6 +9269,8 @@ void wxGrid::SetRowSize( int row, int height )
 {
     wxCHECK_RET( row >= 0 && row < m_numRows, _T("invalid row index") );
 
+    // See comment in SetColSize
+    if ( height < GetRowMinimalAcceptableHeight()) { return; }
 
     if ( m_rowHeights.IsEmpty() )
     {
@@ -9311,7 +9313,15 @@ void wxGrid::SetColSize( int col, int width )
     wxCHECK_RET( col >= 0 && col < m_numCols, _T("invalid column index") );
 
     // should we check that it's bigger than GetColMinimalWidth(col) here?
-
+    //                                                                 (VZ)
+    // No, because it is reasonable to assume the library user know's
+    // what he is doing. However whe should test against the weaker 
+    // constariant of minimalAcceptableWidth, as this breaks rendering
+    // 
+    // This test then fixes sf.net bug #645734
+    
+    if ( width < GetColMinimalAcceptableWidth()) { return; }
+    
     if ( m_colWidths.IsEmpty() )
     {
         // need to really create the array