diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-08 12:00:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-08 15:23:52 +0100 |
commit | ed0b12f4eadf1f2242f06cbd56804f75376274b1 (patch) | |
tree | 7028abd9cf514c74bd1b795cc6398b0bb433f319 /xmloff/source | |
parent | 5ff283e3b841230a45715e48a251c3c4216d1cec (diff) |
no need to take a copy of the getProcessComponentContext return value
we can just take a "const &".
(found by running clang-tidy with the
performance-unnecessary-copy-initialization warning)
Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLImport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLPlotAreaContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLSeries2Context.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLTools.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/core/DomBuilderContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/core/RDFaExportHelper.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/animationimport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/meta/xmlversion.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/transform/EventOASISTContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/transform/OOo2Oasis.cxx | 2 |
12 files changed, 13 insertions, 13 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 5d3b1693f6f2..a1fac7424cf2 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -441,7 +441,7 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen Reference< chart2::data::XDataSource > lcl_createDataSource( const Sequence< Reference< chart2::data::XLabeledDataSequence > > & aData ) { - Reference< uno::XComponentContext > xContext( + const Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() ); Reference< chart2::data::XDataSink > xSink( xContext->getServiceManager()->createInstanceWithContext( diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index fb9682dd9411..6f98df5da718 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -177,7 +177,7 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries( xDoc->getFirstDiagram(), uno::UNO_QUERY_THROW ); Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); - Reference< uno::XComponentContext > xContext( + const Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() ); if( nCoordinateSystemIndex < aCooSysSeq.getLength()) diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index b4eb49345ae1..4ace40238e47 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -1026,7 +1026,7 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume xSeqProp->setPropertyValue(u"Role"_ustr, uno::Any( aRole )); - Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + const Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext(); Reference< chart2::data::XLabeledDataSequence > xLabelSeq( chart2::data::LabeledDataSequence::create(xContext), uno::UNO_QUERY_THROW ); diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index 62f7a8336155..7022fb6db9ce 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -1221,7 +1221,7 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri Sequence< Reference<chart2::XDataPointCustomLabelField>> xLabels(nLabelCount); auto pxLabels = xLabels.getArray(); - Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); + const Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() ); for( size_t j = 0; j < nLabelCount; ++j ) { Reference< chart2::XDataPointCustomLabelField > xCustomLabel = chart2::DataPointCustomLabelField::create(xContext); diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index dd5d2c1bbf0c..c71867a25613 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -339,7 +339,7 @@ XMLTokenEnum getTokenByChartType( Reference< chart2::data::XLabeledDataSequence2 > GetNewLabeledDataSequence() { - Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); + const Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() ); Reference< chart2::data::XLabeledDataSequence2 > xResult = chart2::data::LabeledDataSequence::create(xContext); return xResult; } diff --git a/xmloff/source/core/DomBuilderContext.cxx b/xmloff/source/core/DomBuilderContext.cxx index 81e0e211002d..83090f9bbc36 100644 --- a/xmloff/source/core/DomBuilderContext.cxx +++ b/xmloff/source/core/DomBuilderContext.cxx @@ -229,7 +229,7 @@ void DomBuilderContext::characters( const OUString& rCharacters ) static Reference<XNode> lcl_createDomInstance() { - Reference<XComponentContext> xContext = comphelper::getProcessComponentContext(); + const Reference<XComponentContext>& xContext = comphelper::getProcessComponentContext(); SAL_WARN_IF( !xContext.is(), "xmloff", "can't get service factory" ); Reference<XDocumentBuilder> xBuilder( DocumentBuilder::create(xContext) ); diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx index 3e575869b476..c5a250be702d 100644 --- a/xmloff/source/core/RDFaExportHelper.cxx +++ b/xmloff/source/core/RDFaExportHelper.cxx @@ -69,7 +69,7 @@ getRelativeReference(SvXMLExport const& rExport, OUString const& rURI) rExport.GetModel(), uno::UNO_QUERY_THROW ); OUString const baseURI( xModelURI->getStringValue() ); - uno::Reference<uno::XComponentContext> xContext( comphelper::getProcessComponentContext() ); + const uno::Reference<uno::XComponentContext>& xContext( comphelper::getProcessComponentContext() ); uno::Reference<uri::XUriReferenceFactory> const xUriFactory = uri::UriReferenceFactory::create( xContext ); diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 608e23cbc225..35358e6b6143 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -510,7 +510,7 @@ AnimationNodeContext::AnimationNodeContext( if( pServiceName ) { - Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + const Reference< XComponentContext >& xContext( ::comphelper::getProcessComponentContext() ); mxNode.set( xContext->getServiceManager()->createInstanceWithContext(OUString::createFromAscii(pServiceName), xContext), diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 1551c418be2d..5af74d7fc93a 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -235,7 +235,7 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement { aEngine = "com.sun.star.drawing.EnhancedCustomShapeEngine"; } - uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + const uno::Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() ); if ( !aEngine.isEmpty() ) { diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx index c4db4450ba35..85ace1eaa4b2 100644 --- a/xmloff/source/meta/xmlversion.cxx +++ b/xmloff/source/meta/xmlversion.cxx @@ -307,7 +307,7 @@ void SAL_CALL XMLVersionListPersistence::store( const uno::Reference< embed::XSt return; // get the services needed for writing the xml data - Reference< uno::XComponentContext > xContext = + const Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext(); Reference< XWriter > xWriter = Writer::create(xContext); @@ -351,7 +351,7 @@ uno::Sequence< util::RevisionTag > SAL_CALL XMLVersionListPersistence::load( con try { if ( xRoot.is() && xRoot->hasByName( sDocName ) && xRoot->isStreamElement( sDocName ) ) { - Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + const Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext(); InputSource aParserInput; diff --git a/xmloff/source/transform/EventOASISTContext.cxx b/xmloff/source/transform/EventOASISTContext.cxx index b98d4077dd20..7982d2b3bc63 100644 --- a/xmloff/source/transform/EventOASISTContext.cxx +++ b/xmloff/source/transform/EventOASISTContext.cxx @@ -127,7 +127,7 @@ static bool ParseURL( const OUString& rAttrValue, OUString* pName, OUString* pLocation ) { - Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + const Reference< css::uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext(); Reference< css::uri::XUriReferenceFactory > xFactory = css::uri::UriReferenceFactory::create(xContext); diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index bf0a71494908..cbec872376cd 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -1704,7 +1704,7 @@ void OOo2OasisTransformer::Initialize( Reference< XInterface > xFilter; if( !m_aSubServiceName.isEmpty() ) { - Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); + const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext(); // get filter component xFilter = xContext->getServiceManager()->createInstanceWithArgumentsAndContext(m_aSubServiceName, rArguments, xContext); |