From 38eaa0c825ec461a296f4ea5f7bdc90f3a6408e9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 12 Jan 2022 21:04:15 +0200 Subject: 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 --- chart2/source/view/inc/VDataSeries.hxx | 1 + chart2/source/view/main/VDataSeries.cxx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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 m_xDataSeries; + css::uno::Reference 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 xDataSource( xDataSeries, uno::UNO_QUERY ); uno::Sequence< uno::Reference< @@ -913,7 +914,7 @@ uno::Reference< beans::XPropertySet > VDataSeries::getPropertiesOfPoint( sal_Int uno::Reference VDataSeries::getPropertiesOfSeries() const { - return uno::Reference(m_xDataSeries, css::uno::UNO_QUERY); + return m_xDataSeriesProps; } static std::unique_ptr getDataPointLabelFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp ) -- cgit