clang-tidy: performance-unnecessary-copy-initialization in xmloff

Change-Id: I086167b3d24c125efac99180012e32d9851d49ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176444
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2024-11-11 22:06:52 +02:00
parent 20d971a587
commit e23be78a6a
6 changed files with 9 additions and 9 deletions

View file

@ -113,7 +113,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
} }
std::vector< OUString > aCompleteResultVector; std::vector< OUString > aCompleteResultVector;
OUString scope = aURLParameter.get_scope(); const OUString& scope = aURLParameter.get_scope();
bool bCaptionsOnly = scope == "Heading"; bool bCaptionsOnly = scope == "Heading";
sal_Int32 hitCount = aURLParameter.get_hitCount(); sal_Int32 hitCount = aURLParameter.get_hitCount();
@ -297,7 +297,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
int nResultCount = aCompleteResultVector.size(); int nResultCount = aCompleteResultVector.size();
for( int r = 0 ; r < nResultCount ; ++r ) for( int r = 0 ; r < nResultCount ; ++r )
{ {
OUString aURL = aCompleteResultVector[r]; const OUString& aURL = aCompleteResultVector[r];
OUString aResultStr = replWith + aURL.subView(replIdx); OUString aResultStr = replWith + aURL.subView(replIdx);
m_aPath.push_back( aResultStr ); m_aPath.push_back( aResultStr );
} }

View file

@ -293,7 +293,7 @@ Reference< chart2::XAxis > lcl_getAxis( const Reference< frame::XModel >& xChart
sal_Int32 nCooSysIndex = 0; sal_Int32 nCooSysIndex = 0;
if( nCooSysIndex < aCooSysSeq.getLength() ) if( nCooSysIndex < aCooSysSeq.getLength() )
{ {
Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[nCooSysIndex] ); const Reference< chart2::XCoordinateSystem >& xCooSys( aCooSysSeq[nCooSysIndex] );
if( xCooSys.is() && nDimensionIndex < xCooSys->getDimension() ) if( xCooSys.is() && nDimensionIndex < xCooSys->getDimension() )
{ {
const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex); const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex);
@ -499,7 +499,7 @@ void SchXMLAxisContext::CreateAxis()
if( aCooSysSeq.hasElements() ) if( aCooSysSeq.hasElements() )
{ {
bool bSwapXandYAxis = false; bool bSwapXandYAxis = false;
Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); const Reference< chart2::XCoordinateSystem >& xCooSys( aCooSysSeq[0] );
Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY ); Reference< beans::XPropertySet > xCooSysProp( xCooSys, uno::UNO_QUERY );
if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue(u"SwapXAndYAxis"_ustr) >>= bSwapXandYAxis ) if( xCooSysProp.is() && ( xCooSysProp->getPropertyValue(u"SwapXAndYAxis"_ustr) >>= bSwapXandYAxis )
&& bSwapXandYAxis ) && bSwapXandYAxis )
@ -675,7 +675,7 @@ void SchXMLAxisContext::CorrectAxisPositions( const Reference< chart2::XChartDoc
uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
if( aCooSysSeq.hasElements() ) if( aCooSysSeq.hasElements() )
{ {
Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); const Reference< chart2::XCoordinateSystem >& xCooSys( aCooSysSeq[0] );
if( xCooSys.is() ) if( xCooSys.is() )
{ {
Reference< chart2::XAxis > xMainXAxis = lcl_getAxis( xCooSys, 0, 0 ); Reference< chart2::XAxis > xMainXAxis = lcl_getAxis( xCooSys, 0, 0 );

View file

@ -158,7 +158,7 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext(
m_rbHasRangeAtPlotArea = false; m_rbHasRangeAtPlotArea = false;
// get Diagram // get Diagram
uno::Reference< chart::XChartDocument > xDoc = rImpHelper.GetChartDocument(); const uno::Reference< chart::XChartDocument >& xDoc = rImpHelper.GetChartDocument();
if( xDoc.is()) if( xDoc.is())
{ {
mxDiagram = xDoc->getDiagram(); mxDiagram = xDoc->getDiagram();

View file

@ -466,7 +466,7 @@ void CreateCategories(
aCooSysSeq( xCooSysCnt->getCoordinateSystems()); aCooSysSeq( xCooSysCnt->getCoordinateSystems());
if( nCooSysIndex < aCooSysSeq.getLength()) if( nCooSysIndex < aCooSysSeq.getLength())
{ {
uno::Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[nCooSysIndex] ); const uno::Reference< chart2::XCoordinateSystem >& xCooSys( aCooSysSeq[nCooSysIndex] );
SAL_WARN_IF( !xCooSys.is(), "xmloff.chart", "xCooSys is NULL"); SAL_WARN_IF( !xCooSys.is(), "xmloff.chart", "xCooSys is NULL");
if( nDimensionIndex < xCooSys->getDimension() ) if( nDimensionIndex < xCooSys->getDimension() )
{ {

View file

@ -1903,7 +1903,7 @@ OUString SvXMLExport::AddEmbeddedXGraphic(uno::Reference<graphic::XGraphic> cons
OUString sURL; OUString sURL;
Graphic aGraphic(rxGraphic); Graphic aGraphic(rxGraphic);
OUString aOriginURL = aGraphic.getOriginURL(); const OUString& aOriginURL = aGraphic.getOriginURL();
if (!aOriginURL.isEmpty()) if (!aOriginURL.isEmpty())
{ {

View file

@ -2919,7 +2919,7 @@ bool XMLTextFieldExport::GetDependentFieldPropertySet(
if (aFields.hasElements()) if (aFields.hasElements())
{ {
// get first one and return // get first one and return
Reference<XDependentTextField> xTField = aFields[0]; const Reference<XDependentTextField>& xTField = aFields[0];
xField.set(xTField, UNO_QUERY); xField.set(xTField, UNO_QUERY);
DBG_ASSERT(xField.is(), DBG_ASSERT(xField.is(),
"Surprisingly, this TextField refuses to be a PropertySet!"); "Surprisingly, this TextField refuses to be a PropertySet!");