diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-28 15:25:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-29 08:44:51 +0000 |
commit | 92c504b5bd9ec81474704f563b23a2fcd422d1d1 (patch) | |
tree | 77522afbad0bcc4438936417478dfc3282743c83 | |
parent | 5e482317a0b140b11220554753e30ccfd53385ee (diff) |
use more concrete types in chart2
Change-Id: I818253350bd954d3a2a0f302493c896eb2e26994
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149675
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | chart2/inc/ChartView.hxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx | 3 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/ObjectNameProvider.cxx | 4 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Properties.cxx | 2 | ||||
-rw-r--r-- | chart2/source/inc/AxisHelper.hxx | 17 | ||||
-rw-r--r-- | chart2/source/inc/chartview/ExplicitValueProvider.hxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/AxisHelper.cxx | 37 | ||||
-rw-r--r-- | chart2/source/tools/ObjectIdentifier.cxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 2 |
11 files changed, 13 insertions, 62 deletions
diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx index ea41dc7d667d..9c80ba2ffb55 100644 --- a/chart2/inc/ChartView.hxx +++ b/chart2/inc/ChartView.hxx @@ -115,7 +115,7 @@ public: // ___ExplicitValueProvider___ virtual bool getExplicitValuesForAxis( - css::uno::Reference< css::chart2::XAxis > xAxis + rtl::Reference< ::chart::Axis > xAxis , ExplicitScaleData& rExplicitScale , ExplicitIncrementData& rExplicitIncrement ) override; virtual rtl::Reference< SvxShape > diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx index f3ea07e23a3a..5bcd8857e625 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx @@ -139,7 +139,7 @@ rtl::Reference<SvxDrawPage> Chart2ModelContact::getDrawPage() const } void Chart2ModelContact::getExplicitValuesForAxis( - const Reference< XAxis > & xAxis, + const rtl::Reference< Axis > & xAxis, ExplicitScaleData & rOutExplicitScale, ExplicitIncrementData & rOutExplicitIncrement ) { diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx index 505bc1e144e6..261f2686240a 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx @@ -70,7 +70,7 @@ public: case properties are 'auto'. */ void getExplicitValuesForAxis( - const css::uno::Reference< css::chart2::XAxis > & xAxis, + const rtl::Reference< ::chart::Axis > & xAxis, ExplicitScaleData & rOutExplicitScale, ExplicitIncrementData & rOutExplicitIncrement ); diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx index 0d91f70b7c2c..0edbf16bc9fb 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx @@ -20,6 +20,7 @@ #include "WrappedScaleProperty.hxx" #include "Chart2ModelContact.hxx" #include <CommonConverters.hxx> +#include <Axis.hxx> #include <AxisHelper.hxx> #include <com/sun/star/chart2/AxisType.hpp> #include <com/sun/star/chart2/XAxis.hpp> @@ -349,7 +350,7 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const { Any aRet( m_aOuterValue ); - Reference< chart2::XAxis > xAxis( xInnerPropertySet, uno::UNO_QUERY ); + rtl::Reference< Axis > xAxis = dynamic_cast<Axis*>(xInnerPropertySet.get()); OSL_ENSURE(xAxis.is(),"need an XAxis"); if(!xAxis.is()) return aRet; diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index f3356724db53..64e440a9e3c7 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -334,8 +334,8 @@ OUString ObjectNameProvider::getAxisName( std::u16string_view rObjectCID { OUString aRet; - Reference< XAxis > xAxis( - ObjectIdentifier::getObjectPropertySet( rObjectCID , xChartModel ), uno::UNO_QUERY ); + rtl::Reference< ::chart::Axis > xAxis = + dynamic_cast<::chart::Axis*>(ObjectIdentifier::getObjectPropertySet( rObjectCID , xChartModel ).get()); sal_Int32 nCooSysIndex = 0; sal_Int32 nDimensionIndex = 0; diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index dad8b3f9f72d..49dd90f793d5 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -157,7 +157,7 @@ wrapper::ItemConverter* createItemConverter( ExplicitIncrementData aExplicitIncrement; if( pExplicitValueProvider ) pExplicitValueProvider->getExplicitValuesForAxis( - uno::Reference< XAxis >( xObjectProperties, uno::UNO_QUERY ), + dynamic_cast< Axis* >( xObjectProperties.get() ), aExplicitScale, aExplicitIncrement ); pItemConverter = new wrapper::AxisItemConverter( diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx index 442ab586af1a..5b9de9d9a1b0 100644 --- a/chart2/source/inc/AxisHelper.hxx +++ b/chart2/source/inc/AxisHelper.hxx @@ -117,10 +117,6 @@ public: static rtl::Reference< ::chart::BaseCoordinateSystem > getCoordinateSystemOfAxis( - const css::uno::Reference< css::chart2::XAxis >& xAxis - , const rtl::Reference< ::chart::Diagram >& xDiagram ); - static rtl::Reference< ::chart::BaseCoordinateSystem > - getCoordinateSystemOfAxis( const rtl::Reference< ::chart::Axis >& xAxis , const rtl::Reference< ::chart::Diagram >& xDiagram ); @@ -132,14 +128,11 @@ public: , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys ); static rtl::Reference< ::chart::Axis > - getCrossingMainAxis( const css::uno::Reference< css::chart2::XAxis >& xAxis - , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys ); - static rtl::Reference< ::chart::Axis > getCrossingMainAxis( const rtl::Reference< ::chart::Axis >& xAxis , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys ); static rtl::Reference< ::chart::Axis > - getParallelAxis( const css::uno::Reference< css::chart2::XAxis >& xAxis + getParallelAxis( const rtl::Reference< ::chart::Axis >& xAxis , const rtl::Reference< ::chart::Diagram >& xDiagram ); static rtl::Reference< ::chart::GridProperties > @@ -154,19 +147,11 @@ public: , const rtl::Reference< ::chart::Diagram >& xDiagram ); static bool getIndicesForAxis( - const css::uno::Reference< css::chart2::XAxis >& xAxis - , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys - , sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex ); - static bool getIndicesForAxis( const rtl::Reference< ::chart::Axis >& xAxis , const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys , sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex ); static bool getIndicesForAxis( - const css::uno::Reference< css::chart2::XAxis >& xAxis - , const rtl::Reference< ::chart::Diagram >& xDiagram - , sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex ); - static bool getIndicesForAxis( const rtl::Reference< ::chart::Axis >& xAxis , const rtl::Reference< ::chart::Diagram >& xDiagram , sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex ); diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx index d298c5e49e8a..4370e38cf1b8 100644 --- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx +++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx @@ -56,7 +56,7 @@ public: If the given Axis could not be found or for another reason no correct output can be given false is returned. */ virtual bool getExplicitValuesForAxis( - css::uno::Reference< css::chart2::XAxis > xAxis + rtl::Reference< ::chart::Axis > xAxis , ExplicitScaleData& rExplicitScale , ExplicitIncrementData& rExplicitIncrement )=0; diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index b25b76e8e25c..3fe146d259bc 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -592,14 +592,6 @@ rtl::Reference< Axis > AxisHelper::getAxis( sal_Int32 nDimensionIndex, sal_Int32 return xRet; } -rtl::Reference< Axis > AxisHelper::getCrossingMainAxis( const Reference< chart2::XAxis >& xAxis - , const rtl::Reference< BaseCoordinateSystem >& xCooSys ) -{ - rtl::Reference< Axis > pAxis = dynamic_cast<Axis*>(xAxis.get()); - assert(pAxis || !xAxis); - return getCrossingMainAxis(pAxis, xCooSys); -} - rtl::Reference< Axis > AxisHelper::getCrossingMainAxis( const rtl::Reference< Axis >& xAxis , const rtl::Reference< BaseCoordinateSystem >& xCooSys ) { @@ -620,7 +612,7 @@ rtl::Reference< Axis > AxisHelper::getCrossingMainAxis( const rtl::Reference< Ax return AxisHelper::getAxis( nDimensionIndex, 0, xCooSys ); } -rtl::Reference< Axis > AxisHelper::getParallelAxis( const Reference< XAxis >& xAxis +rtl::Reference< Axis > AxisHelper::getParallelAxis( const rtl::Reference< Axis >& xAxis , const rtl::Reference< Diagram >& xDiagram ) { try @@ -717,16 +709,6 @@ sal_Int32 AxisHelper::getDimensionIndexOfAxis( } bool AxisHelper::getIndicesForAxis( - const Reference< chart2::XAxis >& xAxis - , const rtl::Reference< BaseCoordinateSystem >& xCooSys - , sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex ) -{ - rtl::Reference< Axis > pAxis = dynamic_cast<Axis*>(xAxis.get()); - assert(pAxis || !xAxis); - return getIndicesForAxis(pAxis, xCooSys, rOutDimensionIndex, rOutAxisIndex); -} - -bool AxisHelper::getIndicesForAxis( const rtl::Reference< Axis >& xAxis , const rtl::Reference< BaseCoordinateSystem >& xCooSys , sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex ) @@ -758,14 +740,6 @@ bool AxisHelper::getIndicesForAxis( return false; } -bool AxisHelper::getIndicesForAxis( const Reference< chart2::XAxis >& xAxis, const rtl::Reference< Diagram >& xDiagram - , sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex ) -{ - rtl::Reference< Axis > pAxis = dynamic_cast<Axis*>(xAxis.get()); - assert(pAxis || !xAxis); - return getIndicesForAxis(pAxis, xDiagram, rOutCooSysIndex, rOutDimensionIndex, rOutAxisIndex); -} - bool AxisHelper::getIndicesForAxis( const rtl::Reference< Axis >& xAxis, const rtl::Reference< Diagram >& xDiagram , sal_Int32& rOutCooSysIndex, sal_Int32& rOutDimensionIndex, sal_Int32& rOutAxisIndex ) { @@ -1002,15 +976,6 @@ bool AxisHelper::changeVisibilityOfGrids( const rtl::Reference< Diagram >& xDiag } rtl::Reference< BaseCoordinateSystem > AxisHelper::getCoordinateSystemOfAxis( - const Reference< XAxis >& xAxis - , const rtl::Reference< Diagram >& xDiagram ) -{ - rtl::Reference< Axis > pAxis = dynamic_cast<Axis*>(xAxis.get()); - assert(pAxis || !xAxis); - return getCoordinateSystemOfAxis(pAxis, xDiagram); -} - -rtl::Reference< BaseCoordinateSystem > AxisHelper::getCoordinateSystemOfAxis( const rtl::Reference< Axis >& xAxis , const rtl::Reference< Diagram >& xDiagram ) { diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 5caccd7a8f8e..008e46ff845b 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -330,7 +330,7 @@ OUString ObjectIdentifier::createClassifiedIdentifierForObject( } //axis - Reference< XAxis > xAxis( xObject, uno::UNO_QUERY ); + rtl::Reference< Axis > xAxis = dynamic_cast<Axis*>( xObject.get() ); if( xAxis.is() ) { rtl::Reference< BaseCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis( xAxis, ChartModelHelper::findDiagram( xChartModel ) ) ); diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index fdc75aa155e0..449c3920379f 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -780,7 +780,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D } bool ChartView::getExplicitValuesForAxis( - uno::Reference< XAxis > xAxis + rtl::Reference< Axis > xAxis , ExplicitScaleData& rExplicitScale , ExplicitIncrementData& rExplicitIncrement ) { |