sc/source/core/data/table1.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
New commits: commit febe6a57f9bc9145ffc8e9faeb34b8ac5af1c718 Author: Eike Rathke <er...@redhat.com> AuthorDate: Mon Feb 11 16:28:22 2019 +0100 Commit: Eike Rathke <er...@redhat.com> CommitDate: Mon Feb 11 19:28:50 2019 +0100 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 <er...@redhat.com> Tested-by: Jenkins diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index dd9df5503fa6..a39376aaa390 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits