summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-01-12 21:04:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-13 07:37:09 +0100
commit38eaa0c825ec461a296f4ea5f7bdc90f3a6408e9 (patch)
tree97cb407b6a86c5db00003b41509342d87b8b350f
parentbfe32f3e50b5406810e740ac41368f101033e766 (diff)
cache result of query for dataseries properties
shaves some time off the perf profile of large charts Change-Id: Ic9feab719d784b2e58e96c8a1c642d363d3c5f27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128355 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--chart2/source/view/inc/VDataSeries.hxx1
-rw-r--r--chart2/source/view/main/VDataSeries.cxx3
2 files changed, 3 insertions, 1 deletions
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index bfbc6c9b20ea..11d916510961 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -195,6 +195,7 @@ public: //member
private: //member
css::uno::Reference<css::chart2::XDataSeries> m_xDataSeries;
+ css::uno::Reference<css::beans::XPropertySet> m_xDataSeriesProps; // cached
//all points given by the model data (here are not only the visible points meant)
sal_Int32 m_nPointCount;
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 8ae407488b8d..a650adcef066 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -159,6 +159,7 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
, mpOldSeries(nullptr)
, mnPercent(0.0)
{
+ m_xDataSeriesProps.set(m_xDataSeries, css::uno::UNO_QUERY);
uno::Reference<data::XDataSource> xDataSource( xDataSeries, uno::UNO_QUERY );
uno::Sequence< uno::Reference<
@@ -913,7 +914,7 @@ uno::Reference< beans::XPropertySet > VDataSeries::getPropertiesOfPoint( sal_Int
uno::Reference<beans::XPropertySet> VDataSeries::getPropertiesOfSeries() const
{
- return uno::Reference<css::beans::XPropertySet>(m_xDataSeries, css::uno::UNO_QUERY);
+ return m_xDataSeriesProps;
}
static std::unique_ptr<DataPointLabel> getDataPointLabelFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp )