Kaydet (Commit) b21d7620 authored tarafından Luboš Luňák's avatar Luboš Luňák Kaydeden (comit) Michael Meeks

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: 's avatarMichael Meeks <michael.meeks@collabora.com>
Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
(cherry picked from commit beba45a5)
Reviewed-on: https://gerrit.libreoffice.org/68512
üst 5f755c64
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment