sc/source/ui/docshell/docsh3.cxx | 3 +++ 1 file changed, 3 insertions(+)
New commits: commit 40f6e9a45edae06556e1d1a26237dc2ab12bc0ca Author: Julien Nabet <[email protected]> AuthorDate: Mon Mar 4 13:21:06 2024 +0100 Commit: Adolfo Jayme Barrientos <[email protected]> CommitDate: Tue Mar 19 22:22:45 2024 +0100 tdf#159373: band-aid for crash in: ScTable::HasAttrib band-aid because as Eike indicated in https://bugs.documentfoundation.org/show_bug.cgi?id=159373#c8 "Question remains why this PostPaint() is called at all for an invalid range.." Change-Id: Ie44378119202addd8ddb46f0be4b0124be9fd48b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164354 Tested-by: Jenkins Reviewed-by: Julien Nabet <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164644 (cherry picked from commit 2bb8b6df61d3fd27d38a9ac1724295b885e5e919) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164627 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Adolfo Jayme Barrientos <[email protected]> Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 96546d11a5fe..4634c5cbf191 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -118,6 +118,9 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sa SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row(); SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = std::min<SCTAB>(nMaxTab, rRange.aEnd.Tab()); + if (nTab1 < 0 || nTab2 < 0) + continue; + if (!m_pDocument->ValidCol(nCol1)) nCol1 = m_pDocument->MaxCol(); if (!m_pDocument->ValidRow(nRow1)) nRow1 = m_pDocument->MaxRow(); if (!m_pDocument->ValidCol(nCol2)) nCol2 = m_pDocument->MaxCol();
