summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-19 14:24:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-19 18:13:10 +0200
commitfd2ca9607431fc6ca49e37ab6fef228aa72da5f9 (patch)
tree3d0b361783659e3541433c848b5601e160fb21b1 /chart2
parent6500106dff0f0cd86f509ffd01542aab77c21596 (diff)
tdf#148635 cache some chart stuff
cache some intermediate stuff that it does a handful of times when finishing a chart - halves the time taken Change-Id: I75c5621844d4309b64e64219a7c9e2bcd344ce36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133173 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 4327297360d4..9c7a2b5342f7 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -1118,7 +1118,8 @@ public:
private: //member
std::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- mutable Any m_aOuterValue;
+ mutable Any m_aOuterValue;
+ mutable bool m_bDetectedRangeSegmentation { false };
};
}
@@ -1172,15 +1173,19 @@ Any WrappedDataRowSourceProperty::getPropertyValue( const Reference< beans::XPro
bool bHasCategories = true;
uno::Sequence< sal_Int32 > aSequenceMapping;
- if( DataSourceHelper::detectRangeSegmentation(
- m_spChart2ModelContact->getDocumentModel(), aRangeString, aSequenceMapping, bUseColumns
- , bFirstCellAsLabel, bHasCategories ) )
+ if (!m_bDetectedRangeSegmentation)
{
- css::chart::ChartDataRowSource eChartDataRowSource = css::chart::ChartDataRowSource_ROWS;
- if(bUseColumns)
- eChartDataRowSource = css::chart::ChartDataRowSource_COLUMNS;
+ if( DataSourceHelper::detectRangeSegmentation(
+ m_spChart2ModelContact->getDocumentModel(), aRangeString, aSequenceMapping, bUseColumns
+ , bFirstCellAsLabel, bHasCategories ) )
+ {
+ css::chart::ChartDataRowSource eChartDataRowSource = css::chart::ChartDataRowSource_ROWS;
+ if(bUseColumns)
+ eChartDataRowSource = css::chart::ChartDataRowSource_COLUMNS;
- m_aOuterValue <<= eChartDataRowSource;
+ m_aOuterValue <<= eChartDataRowSource;
+ }
+ m_bDetectedRangeSegmentation = true;
}
return m_aOuterValue;