summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-02-25 14:37:48 +0100
committerMichael Meeks <michael.meeks@collabora.com>2019-03-01 12:32:03 +0100
commitb21d76201e8355207721cc442fc4f204f3061a76 (patch)
tree2a11e3b28e3fd44f30c35b3af1b93fea897e9a96
parent5f755c6455684338ccdedacdd560e1188e7fca76 (diff)
avoid std::out_of_range thrown by mdds (tdf#122643)
Calling GetLastDataRow/Pos() with MAXROW as the last row is apparently fine, but if that's an invalid row, but anything beyond that is not ok. ScDependantsCalculator::trimLength() may use such larger "last" row value because it works on a range of cells. Change-Id: I819a4d20a4765e23af6208df5f2e208ac44b694c Reviewed-on: https://gerrit.libreoffice.org/68349 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> (cherry picked from commit beba45a5639bc32ca6893885ca3b1f07e3175c08) Reviewed-on: https://gerrit.libreoffice.org/68512
-rw-r--r--sc/source/core/data/column2.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 1124c162c0c2..1590ab55380b 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1305,7 +1305,7 @@ SCROW ScColumn::GetLastDataPos() const
SCROW ScColumn::GetLastDataPos( SCROW nLastRow, bool bConsiderCellNotes,
bool bConsiderCellDrawObjects ) const
{
- sc::CellStoreType::const_position_type aPos = maCells.position(nLastRow);
+ sc::CellStoreType::const_position_type aPos = maCells.position(std::min(nLastRow,MAXROW));
if (bConsiderCellNotes && !IsNotesEmptyBlock(nLastRow, nLastRow))
return nLastRow;