[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 5 12:15:34 UTC 2021
sc/source/ui/inc/printfun.hxx | 5 +++--
sc/source/ui/view/printfun.cxx | 16 ----------------
2 files changed, 3 insertions(+), 18 deletions(-)
New commits:
commit ca499d820321f938cd731a3a1616dae7180de26b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sun Jul 4 21:22:04 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Jul 5 14:15:00 2021 +0200
speed up exporting very large spreadsheets to pdf
e.g. the one in tdf#102216
takes it from 27m16s to 6min28s
Change-Id: If6cf7dd49cb43f1749da29da91dab6646d4a0626
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118382
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
(cherry picked from commit 8de4f0d77073a2a3850bbcdd09aa7f68c223da01)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118419
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index e9721837a57f..1a5eddea03cd 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <memory>
+#include <map>
#include <pagepar.hxx>
#include <editutil.hxx>
@@ -124,7 +125,7 @@ public:
std::vector<SCCOL> m_aPageEndX;
std::vector<SCROW> m_aPageEndY;
- std::vector<ScPageRowEntry> m_aPageRows;
+ std::map<size_t, ScPageRowEntry> m_aPageRows;
size_t m_nPagesX;
size_t m_nPagesY;
@@ -166,7 +167,7 @@ struct ScPrintState // Save Variables from ScPrintFunc
size_t nTotalY;
std::vector<SCCOL> aPageEndX;
std::vector<SCROW> aPageEndY;
- std::vector<ScPageRowEntry> aPageRows;
+ std::map<size_t, ScPageRowEntry> aPageRows;
ScPrintState()
: nPrintTab(0)
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index f099247cc2c6..77d58b12a7a2 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -2482,10 +2482,7 @@ tools::Long ScPrintFunc::CountPages() // sets also nPag
CalcZoom(i);
if ( aTableParam.bSkipEmpty )
for (nY=0; nY< m_aRanges.m_nPagesY; nY++)
- {
- OSL_ENSURE(nY < m_aRanges.m_aPageRows.size(), "vector access error for aPageRows");
nPages += m_aRanges.m_aPageRows[nY].CountVisible();
- }
else
nPages += static_cast<tools::Long>(m_aRanges.m_nPagesX) * m_aRanges.m_nPagesY;
if ( pPageData )
@@ -2497,10 +2494,7 @@ tools::Long ScPrintFunc::CountPages() // sets also nPag
CalcZoom(RANGENO_NORANGE); // calculate Zoom
if ( aTableParam.bSkipEmpty )
for (nY=0; nY<m_aRanges.m_nPagesY; nY++)
- {
- OSL_ENSURE(nY < m_aRanges.m_aPageRows.size(), "vector access error for aPageRows");
nPages += m_aRanges.m_aPageRows[nY].CountVisible();
- }
else
nPages += static_cast<tools::Long>(m_aRanges.m_nPagesX) * m_aRanges.m_nPagesY;
if ( pPageData )
@@ -2695,7 +2689,6 @@ tools::Long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
nX2 = m_aRanges.m_aPageEndX[nCountX];
for (nCountY=0; nCountY<m_aRanges.m_nPagesY; nCountY++)
{
- OSL_ENSURE(nCountY < m_aRanges.m_aPageRows.size(), "vector access error for aPageRows (!)");
nY1 = m_aRanges.m_aPageRows[nCountY].GetStartRow();
nY2 = m_aRanges.m_aPageRows[nCountY].GetEndRow();
if ( !aTableParam.bSkipEmpty || !m_aRanges.m_aPageRows[nCountY].IsHidden(nCountX) )
@@ -2716,7 +2709,6 @@ tools::Long ScPrintFunc::DoPrint( const MultiSelection& rPageRanges,
{
for (nCountY=0; nCountY<m_aRanges.m_nPagesY; nCountY++)
{
- OSL_ENSURE(nCountY < m_aRanges.m_aPageRows.size(), "vector access error for aPageRows");
nY1 = m_aRanges.m_aPageRows[nCountY].GetStartRow();
nY2 = m_aRanges.m_aPageRows[nCountY].GetEndRow();
nX1 = nStartCol;
@@ -3104,12 +3096,6 @@ void PrintPageRanges::calculate(ScDocument& rDoc,
m_aPageEndY.resize(nRealCnt + 1, SCROW());
}
- // #i123672# use dynamic mem to react on size changes
- if (m_aPageRows.size() < nRealCnt+1)
- {
- m_aPageRows.resize(nRealCnt+1, ScPageRowEntry());
- }
-
// Page alignment/splitting after breaks in Col/RowFlags
// Of several breaks in a hidden area, only one counts.
@@ -3163,7 +3149,6 @@ void PrintPageRanges::calculate(ScDocument& rDoc,
if (!bSkipEmpty || !rDoc.IsPrintEmpty(nPrintTab, nStartCol, nPageStartRow, nEndCol, nRow-1))
{
- OSL_ENSURE(m_nPagesY < m_aPageRows.size(), "vector access error for rPageRows");
m_aPageRows[m_nPagesY].SetStartRow(nPageStartRow);
m_aPageRows[m_nPagesY].SetEndRow(nRow - 1);
m_aPageRows[m_nPagesY].SetPagesX(m_nPagesX);
@@ -3204,7 +3189,6 @@ void PrintPageRanges::calculate(ScDocument& rDoc,
if (!bSkipEmpty || !rDoc.IsPrintEmpty(nPrintTab, nStartCol, nPageStartRow, nEndCol, nEndRow))
{
- OSL_ENSURE(m_nPagesY < m_aPageRows.size(), "vector access error for maPageRows");
m_aPageRows[m_nPagesY].SetStartRow(nPageStartRow);
m_aPageRows[m_nPagesY].SetEndRow(nEndRow);
m_aPageRows[m_nPagesY].SetPagesX(m_nPagesX);
More information about the Libreoffice-commits
mailing list