diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-01-20 21:57:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-21 08:37:04 +0100 |
commit | c53181f3e91d9b8612abbc53307c2a39ca1446f1 (patch) | |
tree | ef2a3a22a502157e730db623a90cfaf98afb8251 /chart2/source/controller/main | |
parent | b682de9bd020d4fba9cafd6858d93c9a70416307 (diff) |
use more concrete types in chart2, Diagram
Change-Id: Ib78f327c8bf1b71c3bb038c029b10e6fe54edaa1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128708
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 | 10 | ||||
-rw-r--r-- | chart2/source/controller/main/PositionAndSizeHelper.cxx | 3 |
2 files changed, 6 insertions, 7 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 440b7314d666..aaa8636e470e 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -231,16 +231,14 @@ bool ChartController::TheModelRef::is() const namespace { css::uno::Reference<css::chart2::XChartType> getChartType( - const css::uno::Reference<css::chart2::XChartDocument>& xChartDoc) + const rtl::Reference<ChartModel>& xChartDoc) { - Reference <chart2::XDiagram > xDiagram = xChartDoc->getFirstDiagram(); + rtl::Reference<Diagram > xDiagram = xChartDoc->getFirstChartDiagram(); if (!xDiagram.is()) { return css::uno::Reference<css::chart2::XChartType>(); } - Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY_THROW ); - - Sequence< Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems()); + Sequence< Reference< chart2::XCoordinateSystem > > xCooSysSequence( xDiagram->getCoordinateSystems()); if (!xCooSysSequence.hasElements()) { return css::uno::Reference<css::chart2::XChartType>(); } @@ -284,7 +282,7 @@ OUString ChartController::GetContextName() return "Grid"; case OBJECTTYPE_DIAGRAM: { - css::uno::Reference<css::chart2::XChartType> xChartType = getChartType(css::uno::Reference<css::chart2::XChartDocument>(getModel(), uno::UNO_QUERY)); + css::uno::Reference<css::chart2::XChartType> xChartType = getChartType(getChartModel()); if (xChartType.is() && xChartType->getChartType() == "com.sun.star.chart2.PieChartType") return "ChartElements"; break; diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx index 63ddb818fd0d..badd2662d125 100644 --- a/chart2/source/controller/main/PositionAndSizeHelper.cxx +++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx @@ -27,6 +27,7 @@ #include <tools/gen.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/Rectangle.hpp> +#include <Diagram.hxx> namespace chart { @@ -167,7 +168,7 @@ bool PositionAndSizeHelper::moveObject( const OUString& rObjectCID ObjectType eObjectType( ObjectIdentifier::getObjectType( rObjectCID ) ); if(eObjectType==OBJECTTYPE_DIAGRAM || eObjectType==OBJECTTYPE_DIAGRAM_WALL || eObjectType==OBJECTTYPE_DIAGRAM_FLOOR) { - xObjectProp.set( ObjectIdentifier::getDiagramForCID( rObjectCID, xChartModel ), uno::UNO_QUERY ); + xObjectProp = ObjectIdentifier::getDiagramForCID( rObjectCID, xChartModel ); if(!xObjectProp.is()) return false; } |