sc/source/ui/view/tabview2.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit c91d0dd01d884916c699bb70219c792aba704846
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Mar 2 10:23:42 2020 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Mar 4 20:34:14 2020 +0100

    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.gran...@collabora.co.uk>
    (cherry picked from commit 7ae33e175007d04021f5e911e3f7f6cbd0966804)
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89959

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 1551678717e9..0437a8b32785 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -745,6 +745,7 @@ void ScTabView::SkipCursorHorizontal(SCCOL& rCurX, SCROW& 
rCurY, SCCOL nOldX, SC
 
     bool bSkipCell = false;
     bool bHFlip = false;
+    auto nMaxCol = pDoc->ClampToAllocatedColumns(nTab, MAXCOL);
     do
     {
         bSkipCell = pDoc->ColHidden(rCurX, nTab) || 
pDoc->IsHorOverlapped(rCurX, rCurY, nTab);
@@ -755,7 +756,7 @@ void ScTabView::SkipCursorHorizontal(SCCOL& rCurX, SCROW& 
rCurY, SCCOL nOldX, SC
 
         if (bSkipCell)
         {
-            if (rCurX <= 0 || rCurX >= MAXCOL)
+            if (rCurX <= 0 || rCurX >= nMaxCol)
             {
                 if (bHFlip)
                 {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to