sc/source/ui/view/printfun.cxx | 4 ++++ 1 file changed, 4 insertions(+)
New commits: commit 317dc8569723d434fe4175a2b665b84fd15f6f99 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Fri Jun 10 00:33:09 2022 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Fri Jun 10 08:12:06 2022 +0200 tdf#135346 clear page row map to avoid invalid "hidden" flags With the print range cache surviving a longer time, we can get to a state where we reuse the page row map (m_xPageRows) that had older "hidden rows" flags still set, but they aren't valid for our new recalculated ranges. The result for this is that in the bug document, the print preview is empty (as hidden flags for the rows was kept but not valid anymore). We don't really benefit from keeping this map, so we can just clear it when we need to recalculate the print ranges. Change-Id: I1f8de889d6f006e700c6f21ef5bfa52a36bcdfc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135567 Tested-by: Tomaž Vajngerl <qui...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index d5f1d8634865..3cb543a8fbaf 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -3090,6 +3090,10 @@ void PrintPageRanges::calculate(ScDocument& rDoc, rDoc.SetPageSize(nPrintTab, rDocSize); + // Clear the map to prevent any outdated values to "survive" when + // we have to recalculate the new values anyway + m_xPageRows->clear(); + // #i123672# use dynamic mem to react on size changes if (m_xPageEndX->size() < static_cast<size_t>(rDoc.MaxCol()) + 1) {