summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-03-02 10:23:42 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-03-11 13:56:27 +0100
commita9f33ad967aeb7582e6522b81beebc8c15cc5016 (patch)
tree59306a5200b4801074a60300cd756872f9a1dd92
parent864480a9086f274f54f84912afc94e0ca025dfc4 (diff)
tdf#126904 calc right arrow large unexpected column jump in protected sheet
regression from commit 7282014e362a1529a36c88eb308df8ed359c2cfa Date: Fri Feb 1 15:15:16 2019 +0100 tdf#50916 Makes numbers of columns dynamic. Change-Id: I3b6f6e5430c97ef52f63c406eb3c3b39b9dd578e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 7ae33e175007d04021f5e911e3f7f6cbd0966804) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89914 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit c3a1880bd26f80272829205b221ebd2b8d1cfafe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89918 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sc/source/ui/view/tabview2.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 6983f2fee4b7..7ed4acd64386 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -739,6 +739,7 @@ void ScTabView::SkipCursorHorizontal(SCCOL& rCurX, SCROW& rCurY, SCCOL nOldX, SC
bool bSkipCell = false;
bool bHFlip = false;
+ auto nMaxCol = pDoc->ClampToAllocatedColumns(nTab, pDoc->MaxCol());
do
{
bSkipCell = pDoc->ColHidden(rCurX, nTab) || pDoc->IsHorOverlapped(rCurX, rCurY, nTab);
@@ -749,7 +750,7 @@ void ScTabView::SkipCursorHorizontal(SCCOL& rCurX, SCROW& rCurY, SCCOL nOldX, SC
if (bSkipCell)
{
- if (rCurX <= 0 || rCurX >= pDoc->MaxCol())
+ if (rCurX <= 0 || rCurX >= nMaxCol)
{
if (bHFlip)
{