diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-15 16:50:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-18 19:27:29 +0000 |
commit | 61e6afb4d556f95d3cb7dc64262d834c627518f1 (patch) | |
tree | 2d37c70ec54479713de5b576060d6cb5206da30c /chart2/source/model | |
parent | 84352224e132c52bcc5ebff44c5a6f8383316f79 (diff) |
move getDataSeriesGroups inside chart2::Diagram
Change-Id: I776e07ad6dce63df9891ab6823811ad20a37e77c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149084
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/model')
-rw-r--r-- | chart2/source/model/main/Diagram.cxx | 16 | ||||
-rw-r--r-- | chart2/source/model/template/ChartTypeTemplate.cxx | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 92b443b744f9..2005eb90feda 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -1210,6 +1210,22 @@ bool Diagram::isCategory() return false; } +std::vector< std::vector< rtl::Reference< DataSeries > > > +Diagram::getDataSeriesGroups() +{ + std::vector< std::vector< rtl::Reference< DataSeries > > > aResult; + + //iterate through all coordinate systems + for( rtl::Reference< BaseCoordinateSystem > const & coords : getBaseCoordinateSystems() ) + { + //iterate through all chart types in the current coordinate system + for( rtl::Reference< ChartType > const & chartType : coords->getChartTypes2() ) + { + aResult.push_back( chartType->getDataSeries2() ); + } + } + return aResult; +} } // namespace chart diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index a23b74af57e8..383fcac73163 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -183,7 +183,7 @@ void ChartTypeTemplate::changeDiagram( const rtl::Reference< Diagram >& xDiagram try { std::vector< std::vector< rtl::Reference< DataSeries > > > aSeriesSeq = - DiagramHelper::getDataSeriesGroups( xDiagram ); + xDiagram->getDataSeriesGroups(); std::vector< rtl::Reference< DataSeries > > aFlatSeriesSeq( FlattenSequence( aSeriesSeq )); const sal_Int32 nFormerSeriesCount = aFlatSeriesSeq.size(); @@ -394,7 +394,7 @@ void ChartTypeTemplate::applyStyles( const rtl::Reference< ::chart::Diagram >& x { // apply chart-type specific styles, like "symbols on" for example std::vector< std::vector< rtl::Reference< DataSeries > > > aNewSeriesSeq( - DiagramHelper::getDataSeriesGroups( xDiagram )); + xDiagram->getDataSeriesGroups()); for( std::size_t i=0; i<aNewSeriesSeq.size(); ++i ) { const sal_Int32 nNumSeries = aNewSeriesSeq[i].size(); |