chart2/source/view/inc/VDataSeries.hxx  |    1 +
 chart2/source/view/main/VDataSeries.cxx |    3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 38eaa0c825ec461a296f4ea5f7bdc90f3a6408e9
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jan 12 21:04:15 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jan 13 07:37:09 2022 +0100

    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.gran...@collabora.co.uk>

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 )

Reply via email to