sc/source/ui/view/printfun.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit f1f15123bb6af38866b40f8e0d0b6530f69e1eca Author: Eike Rathke <er...@redhat.com> AuthorDate: Sat Jul 31 12:25:01 2021 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Sat Jul 31 14:02:40 2021 +0200 Check nNextPageBreak for ScRowBreakIterator::NOT_FOUND, tdf#64703 follow-up Change-Id: Ifa0fd1b53da70018d8d14abd4f8ba347908d5ea9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119732 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 0fc79a76b397..f8e7c302b971 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -3199,7 +3199,8 @@ void PrintPageRanges::calculate(ScDocument& rDoc, else { // Skip all hidden rows until next pagebreak. - nRow = std::min(nLastRow, nNextPageBreak - 1); + nRow = ((nNextPageBreak == ScRowBreakIterator::NOT_FOUND) ? nLastRow : + std::min(nLastRow, nNextPageBreak - 1)); } }