diff options
author | Eike Rathke <erack@redhat.com> | 2019-02-11 16:28:22 +0100 |
---|---|---|
committer | Xisco FaulĂ <xiscofauli@libreoffice.org> | 2019-02-12 13:48:52 +0100 |
commit | 5468cf114b55124f08660ce75be7ca50de49ef0b (patch) | |
tree | c75613f8b6b81df5c39bd710544987898b946fd7 /sc | |
parent | 08c98b7aba639e0d246f3662d7950885f8a81432 (diff) |
Resolves: tdf#123052 correctly init pNextRows[] values for up/back unprotected
Regression from
commit ec68d58afd53ffd5f0f524503dec607e52385c72
CommitDate: Fri Jul 6 14:25:07 2018 +0200
GetNextPos: deduplicate some nMovX code
Change-Id: I0352d44eda587d2c340df4c7d8fe35b7b8591fc1
Reviewed-on: https://gerrit.libreoffice.org/67693
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit febe6a57f9bc9145ffc8e9faeb34b8ac5af1c718)
Reviewed-on: https://gerrit.libreoffice.org/67696
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/table1.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index cef056314e2e..9377c7111a6e 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1523,8 +1523,16 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCCOL nMovX, SCROW nMovY, const SCROW nRowAdd = (bUp ? -1 : 1); sal_uInt16 nWrap = 0; - for (SCCOL i = 0; i < nColCount; ++i) - pNextRows[i] = (i + nStartCol < nCol) ? (nRow + nRowAdd) : nRow; + if (bUp) + { + for (SCCOL i = 0; i < nColCount; ++i) + pNextRows[i] = (i + nStartCol > nCol) ? (nRow + nRowAdd) : nRow; + } + else + { + for (SCCOL i = 0; i < nColCount; ++i) + pNextRows[i] = (i + nStartCol < nCol) ? (nRow + nRowAdd) : nRow; + } do { SCROW nNextRow = pNextRows[nCol - nStartCol] + nRowAdd; |