sc/source/core/data/table1.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit 03849f2bfef3b788c054c1a7dfb521d7d4cd6121 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Jul 25 10:08:38 2023 +0100 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Mon Aug 7 15:16:20 2023 +0200 Resolves: tdf#156462 ctrl+left in calc doesn't always jump to the correct cell since: commit 9e2d48b9e04f7ea895fb095699c32ed8a44eb129 Date: Wed Mar 30 11:58:04 2022 +0200 reduce Calc's INITIALCOLCOUNT to 1 but: commit a680f6988482f13489d6c802b6078d43564ae934 Date: Wed Jun 7 22:48:01 2017 +0530 tdf#50916 : More refactoring in table1.cxx is likely also relevant wrt: "If nCol is in the unallocated range [nLastCol+1, MAXCOL], then move it directly to nLastCol" If the cursor is outside the allocated column range then the search started 1 cell to the left of the last allocated column Change-Id: I854173ad13d50e50d85e9902b31585e8ae3e2c0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154869 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 4fc9013631a8af06086e96675235e9bb4c2b8096) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155180 Reviewed-by: Patrick Luby <plub...@neooffice.org> Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index c5d4de055f8d..5e40d9bc4381 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1342,14 +1342,14 @@ SCCOL ScTable::FindNextVisibleColWithContent( SCCOL nCol, bool bRight, SCROW nRo } else { - // If nCol is in the unallocated range [nLastCol+1, rDocument.MaxCol()], then move it directly to nLastCol + if(nCol == 0) + return 0; + + // If nCol is in the unallocated range [nLastCol+1, rDocument.MaxCol()], then move it directly after nLastCol // as there is no data in the unallocated range. This also makes the search faster and avoids // the need for more range checks in the loop below. if ( nCol > nLastCol ) - nCol = nLastCol; - - if(nCol == 0) - return 0; + nCol = nLastCol + 1; do {