sc/source/ui/view/printfun.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 03e18e8035092d0d95504131e2722722f1edfe0f
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Fri Jun 10 00:33:09 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Jun 10 10:39:49 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>
    (cherry picked from commit 317dc8569723d434fe4175a2b665b84fd15f6f99)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135540
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index ccd015552074..b5d2da8b96c6 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -3091,6 +3091,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)
     {

Reply via email to