]> git.saurik.com Git - wxWidgets.git/commitdiff
* Prevent miminum and actual row and col sizes going below the
authorRoger Gammans <rgammans@computer-surgery.co.uk>
Sun, 18 May 2003 20:15:17 +0000 (20:15 +0000)
committerRoger Gammans <rgammans@computer-surgery.co.uk>
Sun, 18 May 2003 20:15:17 +0000 (20:15 +0000)
   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

src/generic/grid.cpp

index 68412476633e5c0f046e8743824dfc0a6bfc98c1..ef6fddb7e08b8b8398fd6bc40582dbdb9ce9ae24 100644 (file)
@@ -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