sc/source/ui/view/gridwin4.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 83de0e875aec38000f427134950a49aefb9fa865 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Feb 28 12:04:28 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Feb 28 17:13:16 2024 +0100 assertion fails on last rows selection / modification Open Calc hello world spreadsheet Click on cell in column H Press ctrl + shift + down arrow to select and go to the end of sheet (cell H1048576) Click on the H1048576 and type something, Save Refresh browser / reload spreadsheet try to select modified cell, remove content Result: Crash assert(nEndRow >= nStartRow); nEndRow = 1048575 nStartRow = 1048576 likely an assert since: commit a86c00414a43c5d87981ffae1018cb242c5e5e1d Date: Fri Jan 19 14:27:10 2024 +0200 cool#6893 reduce allocation in ScGridWindow::PaintTile but seems harmless for this specific example Change-Id: I1d492c357a7a0a23b9f9cc974c4b9f684aba8648 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164092 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 97b382d50349..d487afb9db03 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1541,9 +1541,15 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, nBottomRightTileCol++; nBottomRightTileRow++; + if (nTopLeftTileCol > rDoc.MaxCol()) + nTopLeftTileCol = rDoc.MaxCol(); + if (nBottomRightTileCol > rDoc.MaxCol()) nBottomRightTileCol = rDoc.MaxCol(); + if (nTopLeftTileRow > MAXTILEDROW) + nTopLeftTileRow = MAXTILEDROW; + if (nBottomRightTileRow > MAXTILEDROW) nBottomRightTileRow = MAXTILEDROW;