sc/source/ui/view/tabview2.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
New commits: commit 4d8cff696cfdb23733b0e91348b28a83f1c3bedc Author: Aron Budea <[email protected]> AuthorDate: Mon Sep 4 03:15:13 2023 +0200 Commit: Henry Castro <[email protected]> CommitDate: Mon Sep 4 15:37:59 2023 +0200 sc: ui: view: Use conditional assignment Change-Id: I51ba012079a955c139a0c55f12a4b141ba536aa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156502 Tested-by: Jenkins Reviewed-by: Henry Castro <[email protected]> diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index 4faa5d89d569..e28ff1d7eeee 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -217,10 +217,7 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY, SCCOL nTempX = rNewX; while (rDoc.IsHorOverlapped(nTempX, rNewY, nRefTab)) { - if (nMovX > 0) - ++nTempX; - else - --nTempX; + nTempX = (nMovX > 0) ? nTempX + 1 : nTempX - 1; if (!checkBoundary(&rDoc, nTempX, rNewY)) break; } @@ -242,10 +239,7 @@ void moveRefByCell(SCCOL& rNewX, SCROW& rNewY, SCROW nTempY = rNewY; while (rDoc.IsVerOverlapped(rNewX, nTempY, nRefTab)) { - if (nMovY > 0) - ++nTempY; - else - --nTempY; + nTempY = (nMovY > 0) ? nTempY + 1 : nTempY - 1; if (!checkBoundary(&rDoc, rNewX, nTempY)) break; }
