diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-01-20 22:18:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-21 13:45:14 +0100 |
commit | 928cb2963844ffd07fdbda6ec55f8de0c51581ff (patch) | |
tree | bfd6329d1c7138e80cd00cf32e4cf5ab9ea558fb /chart2/source/controller/main | |
parent | 4304947164bbcd3fea758df491a730b01d578be2 (diff) |
use more concrete types in chart2, BaseCoordinateSystem
Change-Id: I25fc26c9c3eb861d72c44ac04e502b2f002ef951
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128711
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/controller/main')
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index aaa8636e470e..5be9cc3fe0c3 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -53,6 +53,7 @@ #include <cppuhelper/supportsservice.hxx> #include <comphelper/servicehelper.hxx> +#include <BaseCoordinateSystem.hxx> #include <com/sun/star/awt/XWindowPeer.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> @@ -234,18 +235,14 @@ css::uno::Reference<css::chart2::XChartType> getChartType( const rtl::Reference<ChartModel>& xChartDoc) { rtl::Reference<Diagram > xDiagram = xChartDoc->getFirstChartDiagram(); - if (!xDiagram.is()) { + if (!xDiagram.is()) return css::uno::Reference<css::chart2::XChartType>(); - } - Sequence< Reference< chart2::XCoordinateSystem > > xCooSysSequence( xDiagram->getCoordinateSystems()); - if (!xCooSysSequence.hasElements()) { + const std::vector< rtl::Reference< BaseCoordinateSystem > > xCooSysSequence( xDiagram->getBaseCoordinateSystems()); + if (xCooSysSequence.empty()) return css::uno::Reference<css::chart2::XChartType>(); - } - - Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSysSequence[0], uno::UNO_QUERY_THROW ); - Sequence< Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() ); + Sequence< Reference< chart2::XChartType > > xChartTypeSequence( xCooSysSequence[0]->getChartTypes() ); return xChartTypeSequence[0]; } |