diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-18 14:16:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-18 19:07:00 +0200 |
commit | 03ef97c7605f4d3f537d5a1f31c2f131a439578d (patch) | |
tree | 15cf8ec14132e4a45e53212688ba6fa24d6029ff /sc/inc | |
parent | 683c2e286e2b8f3220481625d085bdde8e1eab29 (diff) |
tdf#131910 speed up chart display
the chart2 module likes cloning ScChart2DataSequence, which can take a
long time if we have lots of data, so share the data via shared_ptr
Change-Id: I4b0948610810c41a8569b97c58b2b52e8e3190f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141501
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/chart2uno.hxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx index a5e4f53b032f..a8ac4422464e 100644 --- a/sc/inc/chart2uno.hxx +++ b/sc/inc/chart2uno.hxx @@ -205,6 +205,7 @@ public: ::std::vector<ScTokenRef>&& rTokens, bool bIncludeHiddenCells ); virtual ~ScChart2DataSequence() override; + ScChart2DataSequence(ScDocument* pDoc, const ScChart2DataSequence&); ScChart2DataSequence(const ScChart2DataSequence&) = delete; ScChart2DataSequence& operator=(const ScChart2DataSequence&) = delete; @@ -324,8 +325,6 @@ private: void StopListeningToAllExternalRefs(); - void CopyData(const ScChart2DataSequence& r); - private: // data array @@ -350,8 +349,10 @@ private: ScChart2DataSequence& mrParent; }; - /** This vector contains the cached data which was calculated with BuildDataCache(). */ - std::vector<Item> m_aDataArray; + /** This vector contains the cached data which was calculated with BuildDataCache(). + We use a shared_ptr because chart likes to Clone this class, which is very + expensive when we have lots of data. */ + std::shared_ptr<std::vector<Item>> m_xDataArray; /** * Cached data for getData. We may also need to cache data for the |