diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 18:27:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-21 08:51:00 +0200 |
commit | 3284309f19bc76f1778988c5314a795a95620e71 (patch) | |
tree | f8c4cee5861bccdfc4b86bc080bf988d3fe78c9f /xmloff/source/chart | |
parent | f9b5657c4cff29f4a0cd65d2789e091f1297a152 (diff) |
loplugin:referencecasting in xmloff
Change-Id: Iac3d56511aacec73bc38f57890c44145a4c13b85
Reviewed-on: https://gerrit.libreoffice.org/76034
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/chart')
-rw-r--r-- | xmloff/source/chart/SchXMLChartContext.cxx | 17 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLLegendContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLPlotAreaContext.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLPropertyMappingContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLSeries2Context.cxx | 8 |
6 files changed, 25 insertions, 29 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index df143274ac32..5d38b50b1dce 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -436,7 +436,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut } // set auto-styles for Area - uno::Reference<beans::XPropertySet> xProp(mrImportHelper.GetChartDocument()->getArea(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xProp = mrImportHelper.GetChartDocument()->getArea(); mrImportHelper.FillAutoStyle(sAutoStyleName, xProp); } @@ -677,10 +677,9 @@ static void lcl_ApplyDataFromRectangularRangeToDiagram( //work around wrong writer ranges ( see Issue 58464 ) { OUString aChartOleObjectName; - uno::Reference< frame::XModel > xModel(xNewDoc, uno::UNO_QUERY ); - if( xModel.is() ) + if( xNewDoc.is() ) { - utl::MediaDescriptor aMediaDescriptor( xModel->getArgs() ); + utl::MediaDescriptor aMediaDescriptor( xNewDoc->getArgs() ); utl::MediaDescriptor::const_iterator aIt( aMediaDescriptor.find( OUString( "HierarchicalDocumentName" ))); @@ -823,7 +822,7 @@ void SchXMLChartContext::EndElement() if( xNewDoc->hasInternalDataProvider() ) SchXMLTableHelper::applyTableToInternalDataProvider( maTable, xNewDoc ); - bool bOlderThan2_3 = SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3( Reference< frame::XModel >( xNewDoc, uno::UNO_QUERY )); + bool bOlderThan2_3 = SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3( xNewDoc ); bool bOldFileWithOwnDataFromRows = (bOlderThan2_3 && bHasOwnData && (meDataRowSource==chart::ChartDataRowSource_ROWS)); // in this case there are range addresses that are simply wrong. if( mbAllRangeAddressesAvailable && !bSpecialHandlingForDonutChart && !mbIsStockChart && @@ -886,7 +885,7 @@ void SchXMLChartContext::EndElement() , SchXMLSeriesHelper::getDataSeriesIndexMapFromDiagram(xNewDiagram) ); } - SchXMLSeries2Context::initSeriesPropertySets( maSeriesDefaultsAndStyles, uno::Reference< frame::XModel >(xDoc, uno::UNO_QUERY ) ); + SchXMLSeries2Context::initSeriesPropertySets( maSeriesDefaultsAndStyles, xDoc ); //set defaults from diagram to the new series: //check whether we need to remove lines from symbol only charts @@ -1056,7 +1055,7 @@ SvXMLImportContextRef SchXMLChartContext::CreateChildContext( { xProp->setPropertyValue("HasMainTitle", uno::makeAny(true) ); } - uno::Reference< drawing::XShape > xTitleShape( xDoc->getTitle(), uno::UNO_QUERY ); + uno::Reference< drawing::XShape > xTitleShape = xDoc->getTitle(); pContext = new SchXMLTitleContext( mrImportHelper, GetImport(), rLocalName, maMainTitle, xTitleShape ); } @@ -1069,7 +1068,7 @@ SvXMLImportContextRef SchXMLChartContext::CreateChildContext( { xProp->setPropertyValue("HasSubTitle", uno::makeAny(true) ); } - uno::Reference< drawing::XShape > xTitleShape( xDoc->getSubTitle(), uno::UNO_QUERY ); + uno::Reference< drawing::XShape > xTitleShape = xDoc->getSubTitle(); pContext = new SchXMLTitleContext( mrImportHelper, GetImport(), rLocalName, maSubTitle, xTitleShape ); } @@ -1117,7 +1116,7 @@ SvXMLImportContextRef SchXMLChartContext::CreateChildContext( { uno::Reference< drawing::XDrawPageSupplier > xSupp( xDoc, uno::UNO_QUERY ); if( xSupp.is()) - mxDrawPage.set( xSupp->getDrawPage(), uno::UNO_QUERY ); + mxDrawPage = xSupp->getDrawPage(); SAL_WARN_IF( !mxDrawPage.is(), "xmloff.chart", "Invalid Chart Page" ); } diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 46214498958b..c898c9514fdc 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1149,7 +1149,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument > // get property states for autostyles if( mxExpPropMapper.is()) { - Reference< beans::XPropertySet > xPropSet( rChartDoc->getArea(), uno::UNO_QUERY ); + Reference< beans::XPropertySet > xPropSet = rChartDoc->getArea(); if( xPropSet.is()) aPropertyStates = mxExpPropMapper->Filter( xPropSet ); } @@ -1448,7 +1448,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument > SAL_WARN_IF( !xSupplier.is(), "xmloff.chart", "Cannot retrieve draw page to initialize shape export" ); if( xSupplier.is() ) { - Reference< drawing::XShapes > xDrawPage( xSupplier->getDrawPage(), uno::UNO_QUERY ); + Reference< drawing::XShapes > xDrawPage = xSupplier->getDrawPage(); SAL_WARN_IF( !xDrawPage.is(), "xmloff.chart", "Invalid draw page for initializing shape export" ); if( xDrawPage.is()) mrExport.GetShapeExport()->seekShapes( xDrawPage ); @@ -1856,11 +1856,10 @@ void SchXMLExportHelper_Impl::exportPlotArea( } // attributes - Reference< drawing::XShape > xShape ( xDiagram, uno::UNO_QUERY ); - if( xShape.is()) + if( xDiagram.is()) { - addPosition( xShape ); - addSize( xShape ); + addPosition( xDiagram ); + addSize( xDiagram ); } bool bIs3DChart = false; @@ -1996,7 +1995,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( // remove property states for autostyles aPropertyStates.clear(); - Reference< beans::XPropertySet > xWallPropSet( xWallFloorSupplier->getWall(), uno::UNO_QUERY ); + Reference< beans::XPropertySet > xWallPropSet = xWallFloorSupplier->getWall(); if( xWallPropSet.is()) { aPropertyStates = mxExpPropMapper->Filter( xWallPropSet ); @@ -2022,7 +2021,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( // remove property states for autostyles aPropertyStates.clear(); - Reference< beans::XPropertySet > xFloorPropSet( xWallFloorSupplier->getFloor(), uno::UNO_QUERY ); + Reference< beans::XPropertySet > xFloorPropSet = xWallFloorSupplier->getFloor(); if( xFloorPropSet.is()) { aPropertyStates = mxExpPropMapper->Filter( xFloorPropSet ); diff --git a/xmloff/source/chart/SchXMLLegendContext.cxx b/xmloff/source/chart/SchXMLLegendContext.cxx index 1f0f25f2c138..c1c3da637a5d 100644 --- a/xmloff/source/chart/SchXMLLegendContext.cxx +++ b/xmloff/source/chart/SchXMLLegendContext.cxx @@ -106,7 +106,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu } } - uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY ); + uno::Reference< drawing::XShape > xLegendShape = xDoc->getLegend(); uno::Reference< beans::XPropertySet > xLegendProps( xLegendShape, uno::UNO_QUERY ); if( !xLegendShape.is() || !xLegendProps.is() ) { diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 1cf2785030a1..342fd37bdb90 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -170,7 +170,7 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext( m_rbHasRangeAtPlotArea = false; // get Diagram - uno::Reference< chart::XChartDocument > xDoc( rImpHelper.GetChartDocument(), uno::UNO_QUERY ); + uno::Reference< chart::XChartDocument > xDoc = rImpHelper.GetChartDocument(); if( xDoc.is()) { mxDiagram = xDoc->getDiagram(); @@ -785,10 +785,9 @@ void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttr } // set properties - uno::Reference< beans::XPropertySet > xProp( ( meContextType == CONTEXT_TYPE_WALL ) + uno::Reference< beans::XPropertySet > xProp = ( meContextType == CONTEXT_TYPE_WALL ) ? mxWallFloorSupplier->getWall() - : mxWallFloorSupplier->getFloor(), - uno::UNO_QUERY ); + : mxWallFloorSupplier->getFloor(); if (!sAutoStyleName.isEmpty()) mrImportHelper.FillAutoStyle(sAutoStyleName, xProp); @@ -1106,8 +1105,7 @@ void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax { aStyle.meType = DataRowPointStyle::ERROR_INDICATOR; - uno::Reference< lang::XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory(), - uno::UNO_QUERY ); + uno::Reference< lang::XMultiServiceFactory > xFact = comphelper::getProcessServiceFactory(); uno::Reference< beans::XPropertySet > xBarProp( xFact->createInstance("com.sun.star.chart2.ErrorBar" ), uno::UNO_QUERY ); diff --git a/xmloff/source/chart/SchXMLPropertyMappingContext.cxx b/xmloff/source/chart/SchXMLPropertyMappingContext.cxx index 1319704669af..7f193316cb69 100644 --- a/xmloff/source/chart/SchXMLPropertyMappingContext.cxx +++ b/xmloff/source/chart/SchXMLPropertyMappingContext.cxx @@ -111,7 +111,7 @@ void SchXMLPropertyMappingContext::StartElement(const uno::Reference< xml::sax:: createAndAddSequenceToSeries(aRole, aRange, xChartDoc, mxDataSeries); mrLSequencesPerIndex.emplace( tSchXMLIndexWithPart( 0, SCH_XML_PART_VALUES), - Reference< chart2::data::XLabeledDataSequence >( xSeq, UNO_QUERY )); + xSeq); } } diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index 857e47435c5c..9b2af97f4c33 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -846,7 +846,7 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe if( bIsStockChart ) { if( SchXMLSeriesHelper::isCandleStickSeries( seriesStyle.m_xSeries - , uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) ) + , rImportHelper.GetChartDocument() ) ) bIsMinMaxSeries = true; } if( !bIsMinMaxSeries ) @@ -913,7 +913,7 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( if( !aServiceName.isEmpty() ) { - Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY ); + Reference< lang::XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory(); Reference< chart2::XRegressionCurve > xRegCurve( xMSF->createInstance( aServiceName ), uno::UNO_QUERY_THROW ); Reference< chart2::XRegressionCurveContainer > xRegCurveCont( regressionStyle.m_xSeries, uno::UNO_QUERY_THROW ); @@ -1028,7 +1028,7 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri //... todo ... if( bIsStockChart ) { - if( SchXMLSeriesHelper::isCandleStickSeries( seriesStyle.m_xSeries, uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) ) + if( SchXMLSeriesHelper::isCandleStickSeries( seriesStyle.m_xSeries, rImportHelper.GetChartDocument() ) ) continue; } @@ -1039,7 +1039,7 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri { uno::Reference< beans::XPropertySet > xPointProp( SchXMLSeriesHelper::createOldAPIDataPointPropertySet( seriesStyle.m_xSeries, seriesStyle.m_nPointIndex + i - , uno::Reference< frame::XModel >( rImportHelper.GetChartDocument(), uno::UNO_QUERY ) ) ); + , rImportHelper.GetChartDocument() ) ); if( !xPointProp.is() ) continue; |