summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-06-10 00:33:09 +0200
committerAndras Timar <andras.timar@collabora.com>2022-06-24 13:26:52 +0200
commita5fc80cf2c39226d08f237c5ac02269dba8679b4 (patch)
tree65004004cc29f464ca3ed83a08fb8e3d88a7cc94 /sc
parenta9c5a92e7832ec0313efce464361402db8355232 (diff)
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 <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 317dc8569723d434fe4175a2b665b84fd15f6f99) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135540 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/printfun.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 94e674a8fe56..3021bbbd5715 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -3094,6 +3094,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)
{