summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2017-12-02 17:19:33 +0100
committerMarco Cecchetti <mrcekets@gmail.com>2017-12-10 22:41:59 +0100
commitae80e14a28306b5892c582bfe2082ce56b3edbe7 (patch)
treeceeb22f0534a617d0a3ed6d674c01d54cc344b8d
parentafd1a6b516c634392b02beaed51e0ac2a9f877ce (diff)
lok: calc: fix: CTRL+RIGHT => crash
Change-Id: I5c127aa4cbdca5e13d2329c1fb68f466464fe432 Reviewed-on: https://gerrit.libreoffice.org/45790 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
-rw-r--r--sc/source/ui/view/gridwin4.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index a25a62d3f81d..9387c1e6d79c 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1066,7 +1066,8 @@ namespace {
{
long nTmp = 0; // row/col to render for nPosition
long nLastScrPos = 0, nScrPos = 0;
- while (nScrPos <= nPosition && nTmp < MAXROW)
+ const long nMaxIndex = bRowNotCol ? MAXROW : MAXCOL;
+ while (nScrPos <= nPosition && nTmp < nMaxIndex)
{
long nSize = bRowNotCol ? pDoc->GetRowHeight( nTmp, nTabNo )
: pDoc->GetColWidth( nTmp, nTabNo );