diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-24 15:58:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-24 17:43:25 +0100 |
commit | 4fbec819fc041cddcd64621acdd29bd35f4dd493 (patch) | |
tree | 5919cf487519d55231f5f002d6ec7e5cff583b2e /chart2/source/tools/DiagramHelper.cxx | |
parent | 54930a004e42f76f310c7ae15f61d07fbb7c7bdb (diff) |
use more concrete types in chart2, ChartModel
Change-Id: I86b7fa98a6d4a269637ac042a9bb99b41ab90b0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128870
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 | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index d55ce0873967..ebbe3b528954 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -920,7 +920,7 @@ Sequence< OUString > DiagramHelper::generateAutomaticCategoriesFromCooSys( const Sequence< OUString > DiagramHelper::getExplicitSimpleCategories( ChartModel& rModel ) { - rtl::Reference< BaseCoordinateSystem > xCooSys = ChartModelHelper::getFirstCoordinateSystem( rModel ); + rtl::Reference< BaseCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( &rModel ) ); ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys, rModel ); return aExplicitCategoriesProvider.getSimpleCategories(); } @@ -1020,13 +1020,11 @@ void lcl_switchToTextCategories( const Reference< XChartDocument >& xChartDoc, c } -void DiagramHelper::switchToDateCategories( const Reference< XChartDocument >& xChartDoc ) +void DiagramHelper::switchToDateCategories( const rtl::Reference<::chart::ChartModel>& xChartDoc ) { if(xChartDoc.is()) { - auto pModel = dynamic_cast<ChartModel*>(xChartDoc.get()); - assert(pModel); - ControllerLockGuardUNO aCtrlLockGuard( pModel ); + ControllerLockGuardUNO aCtrlLockGuard( xChartDoc ); Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartDoc ) ); if( xCooSys.is() ) @@ -1037,13 +1035,11 @@ void DiagramHelper::switchToDateCategories( const Reference< XChartDocument >& x } } -void DiagramHelper::switchToTextCategories( const Reference< XChartDocument >& xChartDoc ) +void DiagramHelper::switchToTextCategories( const rtl::Reference<::chart::ChartModel>& xChartDoc ) { if(xChartDoc.is()) { - auto pModel = dynamic_cast<ChartModel*>(xChartDoc.get()); - assert(pModel); - ControllerLockGuardUNO aCtrlLockGuard( pModel ); + ControllerLockGuardUNO aCtrlLockGuard( xChartDoc ); Reference< chart2::XCoordinateSystem > xCooSys( ChartModelHelper::getFirstCoordinateSystem( xChartDoc ) ); if( xCooSys.is() ) @@ -1547,12 +1543,10 @@ static void lcl_ensureRange0to1( double& rValue ) rValue=1.0; } -bool DiagramHelper::setDiagramPositioning( const uno::Reference< frame::XModel >& xChartModel, +bool DiagramHelper::setDiagramPositioning( const rtl::Reference<::chart::ChartModel>& xChartModel, const awt::Rectangle& rPosRect /*100th mm*/ ) { - auto pModel = dynamic_cast<ChartModel*>(xChartModel.get()); - assert(pModel); - ControllerLockGuardUNO aCtrlLockGuard( pModel ); + ControllerLockGuardUNO aCtrlLockGuard( xChartModel ); bool bChanged = false; awt::Size aPageSize( ChartModelHelper::getPageSize(xChartModel) ); @@ -1594,7 +1588,7 @@ bool DiagramHelper::setDiagramPositioning( const uno::Reference< frame::XModel > return bChanged; } -awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const uno::Reference< frame::XModel >& xChartModel ) +awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const rtl::Reference<::chart::ChartModel>& xChartModel ) { awt::Rectangle aRet(-1,-1,-1,-1); |