X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80acaf25836e222cb9f39f2fbc5c236a1bba0d98..9add93670bb4a38e4007b8422b34b29b6194eecb:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index df678794c9..753fcf01b7 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -668,7 +668,8 @@ bool wxGridCellTextEditor::EndEdit(int row, int col, grid->GetTable()->SetValue(row, col, value); m_startValue = wxEmptyString; - Text()->SetValue(m_startValue); + // No point in setting the text of the hidden control + //Text()->SetValue(m_startValue); return changed; } @@ -4239,28 +4240,11 @@ void wxGrid::CalcDimensions() int x, y; GetViewStart( &x, &y ); - // maybe we don't need scrollbars at all? - // - // also adjust the position to be valid for the new scroll rangs - if ( w <= cw ) - { - w = x = 0; - } - else - { - if ( x >= w ) - x = w - 1; - } - - if ( h <= ch ) - { - h = y = 0; - } - else - { - if ( y >= h ) - y = h - 1; - } + // ensure the position is valid for the new scroll ranges + if ( x >= w ) + x = wxMax( w - 1, 0 ); + if ( y >= h ) + y = wxMax( h - 1, 0 ); // do set scrollbar parameters SetScrollbars( GRID_SCROLL_LINE_X, GRID_SCROLL_LINE_Y,