summaryrefslogtreecommitdiff
path: root/chart2/source/model
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-15 16:27:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-17 13:46:21 +0000
commit57914a4084da9107ec6815b1916a4be117c400bf (patch)
tree3dbd72639ef8e4179655933e90d95f52b7329f46 /chart2/source/model
parentdc6b93011cc5435f367666e43e354c6ab97bbc90 (diff)
move getChartTypes inside chart2::Diagram
Change-Id: I43fd96feb1e3d34a5f3327b2e6398ca4b5e9f928 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149049 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.cxx22
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx4
2 files changed, 22 insertions, 4 deletions
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index aced36a4a98d..6576141dbe65 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -828,8 +828,7 @@ bool Diagram::isSupportingFloorAndWall()
//todo: allow this in future again, if fileversion is available for OLE objects (metastream)
//thus the wrong bottom can be removed on import
- const std::vector< rtl::Reference< ChartType > > aTypes(
- ::chart::DiagramHelper::getChartTypesFromDiagram( this ) );
+ const std::vector< rtl::Reference< ChartType > > aTypes = getChartTypes();
for( rtl::Reference< ChartType > const & xType : aTypes )
{
OUString sChartType = xType->getChartType();
@@ -1023,6 +1022,25 @@ bool Diagram::moveSeries( const rtl::Reference< DataSeries >& xGivenDataSeries,
return bMoved;
}
+std::vector< rtl::Reference< ChartType > > Diagram::getChartTypes()
+{
+ std::vector< rtl::Reference< ChartType > > aResult;
+ try
+ {
+ for( rtl::Reference< BaseCoordinateSystem > const & coords : getBaseCoordinateSystems() )
+ {
+ const std::vector< rtl::Reference< ChartType > > & aChartTypeSeq( coords->getChartTypes2());
+ aResult.insert( aResult.end(), aChartTypeSeq.begin(), aChartTypeSeq.end() );
+ }
+ }
+ catch( const uno::Exception & )
+ {
+ DBG_UNHANDLED_EXCEPTION("chart2");
+ }
+
+ return aResult;
+}
+
} // namespace chart
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index 1e49054f5b8b..17ae7dc215f9 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -224,7 +224,7 @@ void ChartTypeTemplate::changeDiagram( const rtl::Reference< Diagram >& xDiagram
// remove charttype groups from all coordinate systems
std::vector< rtl::Reference< ChartType > > aOldChartTypesSeq =
- DiagramHelper::getChartTypesFromDiagram(xDiagram);
+ xDiagram->getChartTypes();
for( rtl::Reference< BaseCoordinateSystem > const & coords : xDiagram->getBaseCoordinateSystems() )
{
@@ -274,7 +274,7 @@ void ChartTypeTemplate::changeDiagramData(
DiagramHelper::setCategoriesToDiagram( aData.Categories, xDiagram, true, supportsCategories() );
std::vector< rtl::Reference< ChartType > > aChartTypes =
- DiagramHelper::getChartTypesFromDiagram( xDiagram );
+ xDiagram->getChartTypes();
sal_Int32 nMax = std::min( aChartTypes.size(), aData.Series.size());
for( sal_Int32 i=0; i<nMax; ++i )
{