summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-07-25 10:08:38 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-07-25 14:33:57 +0200
commitbbdb62ca2f5545588b2e6d11421c6038425cebab (patch)
treed592c84cee726353b29c14953dfcd5bbc3e13826 /sc/source
parente384be0f6ea6453e57cd4a7c4402d26b49debc41 (diff)
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/+/154885 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/table1.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index fff48f1e0c3f..f6df90738c72 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1350,14 +1350,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
{