diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-15 06:54:31 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-15 08:01:08 +0200 |
commit | 3c364f5d574515a257ba0bb84e199275fbea944f (patch) | |
tree | 107d7b94cb55d163a9c54f6a6c5367087de54084 /sc | |
parent | 4ce6590223ab9a615afcf55ebc0e9cdb3ff2a73a (diff) |
Related: tdf#50916 create valid empty ScHorizontalCellIterator when...
completely outside allocated area.
Prevents crash in spell checker when scrolling into unallocated area, where
first visible column number is greater than maximal allocated column number.
The crash happened when std::vector::reserve threw std::length_error, and
Scheduler::ProcessTaskScheduling abort()ed catching that in std::exception
handler.
Change-Id: Id74706f4a5fedfcc5e4e316c7aea7f5a4fe110be
Reviewed-on: https://gerrit.libreoffice.org/70756
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dociter.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 174ff54c43e8..8458e2895684 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -1924,6 +1924,8 @@ ScHorizontalCellIterator::ScHorizontalCellIterator(ScDocument* pDocument, SCTAB OSL_FAIL("try to access index out of bounds, FIX IT"); nEndCol = pDoc->maTabs[mnTab]->ClampToAllocatedColumns(nEndCol); + if (nEndCol < nStartCol) // E.g., somewhere completely outside allocated area + nEndCol = nStartCol - 1; // Empty maColPositions.reserve( nEndCol-nStartCol+1 ); |