From a01cfc082f372639b071492251600e7ef3d1f3c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 24 Nov 2007 17:53:06 +0000 Subject: [PATCH] ensure that wxGrid::AutoSizeColumn/Row() never sets column/row size smaller than the minimal size git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grid.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 3cd1e3307d..adace08248 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -10537,6 +10537,12 @@ wxGrid::AutoSizeColOrRow(int colOrRow, bool setAsMin, wxGridDirection direction) if ( column ) { + // Ensure automatic width is not less than minimal width. See the + // comment in SetColSize() for explanation of why this isn't done + // in SetColSize(). + if ( !setAsMin ) + extentMax = wxMax(extentMax, GetColMinimalWidth(col)); + SetColSize( col, extentMax ); if ( !GetBatchCount() ) { @@ -10552,6 +10558,12 @@ wxGrid::AutoSizeColOrRow(int colOrRow, bool setAsMin, wxGridDirection direction) } else { + // Ensure automatic width is not less than minimal height. See the + // comment in SetColSize() for explanation of why this isn't done + // in SetRowSize(). + if ( !setAsMin ) + extentMax = wxMax(extentMax, GetRowMinimalHeight(row)); + SetRowSize(row, extentMax); if ( !GetBatchCount() ) { -- 2.50.0