diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-08 14:33:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-08 18:32:33 +0200 |
commit | 11bdb6b9d9df991bb4ee48d4682458facaa2bdd5 (patch) | |
tree | 29180dbac55048e038c404769d059780f39f21a3 /chart2/source | |
parent | c69e5e3cc08bfbb4a5f6c756c523e4016c8fd1dd (diff) |
improve loplugin:referencecasting
to catch a few more cases
Change-Id: I0323fba51bb2b4ba255e1db5aa0d890c5c6a2e1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93726
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/controller/main/ObjectHierarchy.cxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/DiagramHelper.cxx | 10 | ||||
-rw-r--r-- | chart2/source/view/charttypes/VSeriesPlotter.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 2 |
4 files changed, 7 insertions, 10 deletions
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx index bf7c812b16b1..15b5392153b3 100644 --- a/chart2/source/controller/main/ObjectHierarchy.cxx +++ b/chart2/source/controller/main/ObjectHierarchy.cxx @@ -433,7 +433,7 @@ void ImplObjectHierarchy::createDataSeriesTree( ObjectHierarchy::tChildContainer aSeriesSubContainer; - Reference< chart2::XDataSeries > xSeries( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY ); + Reference< chart2::XDataSeries > const & xSeries = aSeriesSeq[nSeriesIdx]; // data labels if( DataSeriesHelper::hasDataLabelsAtSeries( xSeries ) ) diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index d9b1bf064cdf..ab93f06a8096 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -479,20 +479,18 @@ void DiagramHelper::setDimension( //change all coordinate systems: Reference< XCoordinateSystemContainer > xCooSysContainer( xDiagram, uno::UNO_QUERY_THROW ); - Sequence< Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() ); - for( sal_Int32 nCS = 0; nCS < aCooSysList.getLength(); ++nCS ) + const Sequence< Reference< XCoordinateSystem > > aCooSysList( xCooSysContainer->getCoordinateSystems() ); + for( Reference<XCoordinateSystem> const & xOldCooSys : aCooSysList ) { - Reference< XCoordinateSystem > xOldCooSys( aCooSysList[nCS], uno::UNO_QUERY ); Reference< XCoordinateSystem > xNewCooSys; Reference< XChartTypeContainer > xChartTypeContainer( xOldCooSys, uno::UNO_QUERY ); if( !xChartTypeContainer.is() ) continue; - Sequence< Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() ); - for( sal_Int32 nT = 0; nT < aChartTypeList.getLength(); ++nT ) + const Sequence< Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() ); + for( Reference< XChartType > const & xChartType : aChartTypeList ) { - Reference< XChartType > xChartType( aChartTypeList[nT], uno::UNO_QUERY ); bIsSupportingOnlyDeepStackingFor3D = ChartTypeHelper::isSupportingOnlyDeepStackingFor3D( xChartType ); if(!xNewCooSys.is()) { diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 0696efc9dcbb..484fa4362261 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -609,8 +609,7 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re Sequence< uno::Reference< XFormattedString > > aFormattedLabels( aCustomLabels.getLength() ); for( int i = 0; i < aFormattedLabels.getLength(); i++ ) { - uno::Reference< XFormattedString > xString( aCustomLabels[i], uno::UNO_QUERY ); - aFormattedLabels[i] = xString; + aFormattedLabels[i] = aCustomLabels[i]; } // center the text diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index f33f696a898d..84961438c24a 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -544,7 +544,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter( uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() ); for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS ) { - uno::Reference< XDataSeries > xDataSeries( aSeriesList[nS], uno::UNO_QUERY ); + uno::Reference< XDataSeries > const & xDataSeries = aSeriesList[nS]; if(!xDataSeries.is()) continue; if( !bIncludeHiddenCells && !DataSeriesHelper::hasUnhiddenData(xDataSeries) ) |