diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-02-05 14:58:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-05 20:39:03 +0100 |
commit | 333ccb081b4ab62adce50ca4c93162b9baf984d0 (patch) | |
tree | 05c9f99d750a549e9d397735ed62687c75df6b50 /chart2/source/tools/DiagramHelper.cxx | |
parent | 1a4955f2c1158197db74d7cf4f1f0c98c096224c (diff) |
use more concrete types in chart2, Axis
Change-Id: If80b6487ad2b8ac75f98f798b839aff2b8a5c23e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129522
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools/DiagramHelper.cxx')
-rw-r--r-- | chart2/source/tools/DiagramHelper.cxx | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index a20c8bbd7510..c45bb92e663e 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -21,6 +21,7 @@ #include <Diagram.hxx> #include <DataSeries.hxx> #include <DataSeriesHelper.hxx> +#include <Axis.hxx> #include <AxisHelper.hxx> #include <ChartType.hxx> #include <ChartTypeHelper.hxx> @@ -145,7 +146,7 @@ void DiagramHelper::setVertical( const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nDimIndex); for (sal_Int32 nI = 0; nI <= nMaximumScaleIndex; ++nI) { - Reference<chart2::XAxis> xAxis = xCooSys->getAxisByDimension(nDimIndex,nI); + rtl::Reference<Axis> xAxis = xCooSys->getAxisByDimension2(nDimIndex,nI); if (!xAxis.is()) continue; @@ -153,11 +154,7 @@ void DiagramHelper::setVertical( if (!bChanged) continue; - Reference< XTitled > xTitled( xAxis, uno::UNO_QUERY ); - if (!xTitled.is()) - continue; - - Reference< beans::XPropertySet > xTitleProps( xTitled->getTitleObject(), uno::UNO_QUERY ); + Reference< beans::XPropertySet > xTitleProps( xAxis->getTitleObject(), uno::UNO_QUERY ); if (!xTitleProps.is()) continue; @@ -247,7 +244,7 @@ void DiagramHelper::setStackMode( const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(1); for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI) { - Reference< chart2::XAxis > xAxis( xCooSys->getAxisByDimension( 1,nI )); + rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( 1,nI ); if( xAxis.is()) { chart2::ScaleData aScaleData = xAxis->getScaleData(); @@ -379,8 +376,8 @@ StackMode DiagramHelper::getStackModeFromChartType( if( nSeriesCount ) nAxisIndex = DataSeriesHelper::getAttachedAxisIndex(aSeries[0]); - Reference< chart2::XAxis > xAxis( - xCorrespondingCoordinateSystem->getAxisByDimension( 1,nAxisIndex )); + rtl::Reference< Axis > xAxis = + xCorrespondingCoordinateSystem->getAxisByDimension2( 1,nAxisIndex ); if( xAxis.is()) { chart2::ScaleData aScaleData = xAxis->getScaleData(); @@ -547,7 +544,7 @@ bool DiagramHelper::attachSeriesToAxis( bool bAttachToMainAxis if( bChanged && xDiagram.is() ) { - uno::Reference< XAxis > xAxis( AxisHelper::getAxis( 1, bAttachToMainAxis, xDiagram ) ); + rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 1, bAttachToMainAxis, xDiagram ); if(!xAxis.is()) //create an axis if necessary xAxis = AxisHelper::createAxis( 1, bAttachToMainAxis, xDiagram, xContext ); if( bAdaptAxes ) @@ -560,14 +557,14 @@ bool DiagramHelper::attachSeriesToAxis( bool bAttachToMainAxis return bChanged; } -uno::Reference< XAxis > DiagramHelper::getAttachedAxis( +rtl::Reference< Axis > DiagramHelper::getAttachedAxis( const uno::Reference< XDataSeries >& xSeries, const rtl::Reference< Diagram >& xDiagram ) { return AxisHelper::getAxis( 1, DiagramHelper::isSeriesAttachedToMainAxis( xSeries ), xDiagram ); } -uno::Reference< XAxis > DiagramHelper::getAttachedAxis( +rtl::Reference< Axis > DiagramHelper::getAttachedAxis( const rtl::Reference< DataSeries >& xSeries, const rtl::Reference< Diagram >& xDiagram ) { @@ -697,7 +694,7 @@ std::vector< Reference< XAxis > > lcl_getAxisHoldingCategoriesFromDiagram( const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nN); for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI) { - Reference< XAxis > xAxis = xCooSys->getAxisByDimension( nN,nI ); + rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( nN,nI ); OSL_ASSERT( xAxis.is()); if( xAxis.is()) { @@ -738,7 +735,7 @@ bool DiagramHelper::isCategoryDiagram( const sal_Int32 nMaximumScaleIndex = xCooSys->getMaximumAxisIndexByDimension(nN); for(sal_Int32 nI=0; nI<=nMaximumScaleIndex; ++nI) { - Reference< XAxis > xAxis = xCooSys->getAxisByDimension( nN,nI ); + rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( nN,nI ); OSL_ASSERT( xAxis.is()); if( xAxis.is()) { @@ -1009,10 +1006,10 @@ void DiagramHelper::switchToDateCategories( const rtl::Reference<::chart::ChartM { ControllerLockGuardUNO aCtrlLockGuard( xChartDoc ); - Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartDoc ) ); + rtl::Reference< BaseCoordinateSystem > xCooSys = ChartModelHelper::getFirstCoordinateSystem( xChartDoc ); if( xCooSys.is() ) { - Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,0) ); + rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2(0,0); lcl_switchToDateCategories( xChartDoc, xAxis ); } } @@ -1024,10 +1021,10 @@ void DiagramHelper::switchToTextCategories( const rtl::Reference<::chart::ChartM { ControllerLockGuardUNO aCtrlLockGuard( xChartDoc ); - Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartDoc ) ); + rtl::Reference< BaseCoordinateSystem > xCooSys = ChartModelHelper::getFirstCoordinateSystem( xChartDoc ); if( xCooSys.is() ) { - Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,0) ); + rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2(0,0); lcl_switchToTextCategories( xChartDoc, xAxis ); } } |