From 6f00c734cd8b64690774aa0c2e4ed8496edc95ab Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 1 Sep 2022 16:06:36 +0100 Subject: [PATCH] Remove useless check for grid size in wxGrid::FreezeTo() This resulted in silently doing nothing when calling FreezeTo() on a grid which hadn't been resized to its full size yet, which seems wrong and not useful at all, so simply remove this check and freeze the requested rows/columns in any case -- it's the user responsibility to make the grid sufficiently big to allow the user to see the non-frozen parts. --- interface/wx/grid.h | 1 - src/generic/grid.cpp | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/interface/wx/grid.h b/interface/wx/grid.h index 01a032861e..385130db99 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -5644,7 +5644,6 @@ public: Note that this method doesn't do anything, and returns @false, if any of the following conditions are true: - Either @a row or @a col are out of range - - Size of the frozen area would be bigger than the current viewing area - There are any merged cells in the area to be frozen - Grid uses a native header control (see UseNativeColHeader()) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 2c29ea5f5e..a9525c7731 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5459,17 +5459,6 @@ bool wxGrid::FreezeTo(int row, int col) // freeze if ( row > m_numFrozenRows || col > m_numFrozenCols ) { - // check that it fits in client size - int cw, ch; - GetClientSize( &cw, &ch ); - - cw -= m_rowLabelWidth; - ch -= m_colLabelHeight; - - if ((row > 0 && GetRowBottom(row - 1) >= ch) || - (col > 0 && GetColRight(col - 1) >= cw)) - return false; - // check all involved cells for merged ones int cell_rows, cell_cols;