summaryrefslogtreecommitdiff
path: root/sc/source/ui/inc/printfun.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-04 21:33:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-05 12:55:28 +0200
commit580b5f6a3bf671f6590f40795d7cb9e46d52cf9f (patch)
tree75d114d68e3aeb366ff7d96987cdc7468e17a1bf /sc/source/ui/inc/printfun.hxx
parent8de4f0d77073a2a3850bbcdd09aa7f68c223da01 (diff)
speed up exporting very large spreadsheets to pdf(2)
e.g. the one in tdf#102216 instead of copying the data we want back and forth, just share it via shared_ptr. takes it from 6min28s to 1m21 Change-Id: I44d174264baa875e1922d1d46ee07de0e8cbaf0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118383 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/inc/printfun.hxx')
-rw-r--r--sc/source/ui/inc/printfun.hxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 1a5eddea03cd..9ad5c27e547b 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -123,9 +123,10 @@ class PrintPageRanges
public:
PrintPageRanges();
- std::vector<SCCOL> m_aPageEndX;
- std::vector<SCROW> m_aPageEndY;
- std::map<size_t, ScPageRowEntry> m_aPageRows;
+ // use shared_ptr to avoid copying this (potentially large) data back and forth
+ std::shared_ptr<std::vector<SCCOL>> m_xPageEndX;
+ std::shared_ptr<std::vector<SCROW>> m_xPageEndY;
+ std::shared_ptr<std::map<size_t, ScPageRowEntry>> m_xPageRows;
size_t m_nPagesX;
size_t m_nPagesY;
@@ -165,9 +166,10 @@ struct ScPrintState // Save Variables from ScPrintFunc
bool bSavedStateRanges;
sc::PrintPageRangesInput aPrintPageRangesInput;
size_t nTotalY;
- std::vector<SCCOL> aPageEndX;
- std::vector<SCROW> aPageEndY;
- std::map<size_t, ScPageRowEntry> aPageRows;
+ // use shared_ptr to avoid copying this (potentially large) map back and forth
+ std::shared_ptr<std::vector<SCCOL>> xPageEndX;
+ std::shared_ptr<std::vector<SCROW>> xPageEndY;
+ std::shared_ptr<std::map<size_t, ScPageRowEntry>> xPageRows;
ScPrintState()
: nPrintTab(0)