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 /sc/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 'sc/source')
-rw-r--r-- | sc/source/core/tool/addincol.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/excel.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/excimp8.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xltoolbar.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlwrap.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/tablink.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/solverutil.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpcalc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworksheet.cxx | 2 |
13 files changed, 18 insertions, 18 deletions
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index b36f1cd07743..385f61509e8e 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -804,7 +804,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& //TODO: pass XIntrospection to ReadFromAddIn - uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); + const uno::Reference<uno::XComponentContext>& xContext = comphelper::getProcessComponentContext(); uno::Reference<beans::XIntrospection> xIntro = beans::theIntrospection::get( xContext ); uno::Any aObject; @@ -1086,7 +1086,7 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface // only get the function information from Introspection - uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); + const uno::Reference<uno::XComponentContext>& xContext = comphelper::getProcessComponentContext(); uno::Reference<beans::XIntrospection> xIntro = beans::theIntrospection::get(xContext); uno::Any aObject; diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index 1bd34e27e43d..aae72134bf0d 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -87,7 +87,7 @@ static rtl::Reference<SotStorage> lcl_DRMDecrypt(const SfxMedium& rMedium, const // We have DRM encrypted storage. We should try to decrypt it first, if we can uno::Sequence< uno::Any > aArguments; - uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xComponentContext(comphelper::getProcessComponentContext()); uno::Reference< packages::XPackageEncryption > xPackageEncryption( xComponentContext->getServiceManager()->createInstanceWithArgumentsAndContext( u"com.sun.star.comp.oox.crypto.DRMDataSpace"_ustr, aArguments, xComponentContext), uno::UNO_QUERY); @@ -276,7 +276,7 @@ static ErrCode lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument, if (sCryptoType.getLength()) { - uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xComponentContext(comphelper::getProcessComponentContext()); uno::Sequence<uno::Any> aArguments{ uno::Any(beans::NamedValue(u"Binary"_ustr, uno::Any(true))) }; xPackageEncryption.set( diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 9330189c5de9..248e4589971e 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -350,7 +350,7 @@ void ImportExcel8::ReadBasic() } try { - uno::Reference< uno::XComponentContext > aCtx( ::comphelper::getProcessComponentContext() ); + const uno::Reference< uno::XComponentContext >& aCtx( ::comphelper::getProcessComponentContext() ); SfxMedium& rMedium = GetMedium(); uno::Reference< io::XInputStream > xIn = rMedium.GetInputStream(); oox::ole::OleStorage root( aCtx, xIn, false ); diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 096f872fe7b2..06505c35fad3 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -2364,7 +2364,7 @@ bool XclImpChType::HasCategoryLabels() const Reference< XCoordinateSystem > XclImpChType::CreateCoordSystem( bool b3dChart ) const { // create the coordinate system object - Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + const Reference< css::uno::XComponentContext >& xContext = comphelper::getProcessComponentContext(); Reference< XCoordinateSystem > xCoordSystem; if( maTypeInfo.mbPolarCoordSystem ) { diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx index 8e56abde5733..33de884957b1 100644 --- a/sc/source/filter/excel/xltoolbar.cxx +++ b/sc/source/filter/excel/xltoolbar.cxx @@ -418,7 +418,7 @@ void ScCTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) if(rCTB.empty()) return; - uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + const uno::Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() ); uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( ui::theModuleUIConfigurationManagerSupplier::get(xContext) ); for ( auto& rItem : rCTB ) diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 2bab3ae9a43e..86ff69d0ec2d 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -281,7 +281,7 @@ ErrCodeMsg ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCo bool ScXMLImportWrapper::Import( ImportFlags nMode, ErrCodeMsg& rError ) { - uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); + const uno::Reference<uno::XComponentContext>& xContext = comphelper::getProcessComponentContext(); xml::sax::InputSource aParserInput; if (pMedium) @@ -722,7 +722,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly) if (pDrawLayer) pDrawLayer->setLock(bOldLock); - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xContext(comphelper::getProcessComponentContext()); uno::Reference<xml::sax::XWriter> xWriter = xml::sax::Writer::create(xContext); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 4b502120e369..d3e184eb2029 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -841,7 +841,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) try { - uno::Reference< uno::XComponentContext > xContext( + const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() ); uno::Reference< lang::XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), @@ -3211,7 +3211,7 @@ void ScDocShell::ResetKeyBindings( ScOptionsUtil::KeyBindingType eType ) { using namespace ::com::sun::star::ui; - Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext(); + const Reference<uno::XComponentContext>& xContext = ::comphelper::getProcessComponentContext(); if (!xContext.is()) return; diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 1ae715a12276..6df8ec07d8e8 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -113,7 +113,7 @@ namespace aURL.removeSegment(); aURL.removeFinalSlash(); OUString aPath = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); - uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); + const uno::Reference<uno::XComponentContext>& xContext = comphelper::getProcessComponentContext(); _rDrvMgr.set( sdbc::DriverManager::create( xContext ) ); diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index f6d3182e1759..f77c49e64677 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -474,7 +474,7 @@ SfxMedium* ScDocumentLoader::CreateMedium( const OUString& rFileName, std::share if (pInteractionParent) { - css::uno::Reference<css::uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); + const css::uno::Reference<css::uno::XComponentContext>& xContext = comphelper::getProcessComponentContext(); css::uno::Reference<css::task::XInteractionHandler> xIHdl(css::task::InteractionHandler::createWithParent(xContext, pInteractionParent->GetXWindow()), css::uno::UNO_QUERY_THROW); pSet->Put(SfxUnoAnyItem(SID_INTERACTIONHANDLER, css::uno::Any(xIHdl))); diff --git a/sc/source/ui/miscdlgs/solverutil.cxx b/sc/source/ui/miscdlgs/solverutil.cxx index 7b3ac25c9ada..4c88057ec60f 100644 --- a/sc/source/ui/miscdlgs/solverutil.cxx +++ b/sc/source/ui/miscdlgs/solverutil.cxx @@ -42,7 +42,7 @@ void ScSolverUtil::GetImplementations( uno::Sequence<OUString>& rImplNames, rImplNames.realloc(0); // clear rDescriptions.realloc(0); - uno::Reference<uno::XComponentContext> xCtx( + const uno::Reference<uno::XComponentContext>& xCtx( comphelper::getProcessComponentContext() ); uno::Reference<container::XContentEnumerationAccess> xEnAc( @@ -99,7 +99,7 @@ uno::Reference<sheet::XSolver> ScSolverUtil::GetSolver( std::u16string_view rImp { uno::Reference<sheet::XSolver> xSolver; - uno::Reference<uno::XComponentContext> xCtx( + const uno::Reference<uno::XComponentContext>& xCtx( comphelper::getProcessComponentContext() ); uno::Reference<container::XContentEnumerationAccess> xEnAc( diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx index 2a47d28c5e1d..f5f49989e537 100644 --- a/sc/source/ui/optdlg/tpcalc.cxx +++ b/sc/source/ui/optdlg/tpcalc.cxx @@ -72,7 +72,7 @@ ScTpCalcOptions::ScTpCalcOptions(weld::Container* pPage, weld::DialogController* Init(); SetExchangeSupport(); - css::uno::Reference < css::uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); + const css::uno::Reference < css::uno::XComponentContext >& xContext(::comphelper::getProcessComponentContext()); m_xReadWriteAccess = css::configuration::ReadWriteAccess::create(xContext, u"*"_ustr); } diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 4df7c3562b9c..8c4a0c5efa00 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1037,7 +1037,7 @@ uno::Reference< chart2::data::XLabeledDataSequence > lcl_createLabeledDataSequen { try { - uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + const uno::Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() ); if ( xContext.is() ) { xResult.set( chart2::data::LabeledDataSequence::create(xContext), uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 74c06b3603b3..26835553af2d 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -128,7 +128,7 @@ openNewDoc(const OUString& aSheetName ) uno::Reference<frame::XModel> xModel; try { - uno::Reference< uno::XComponentContext > xContext( + const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() ); uno::Reference <frame::XDesktop2 > xComponentLoader = frame::Desktop::create(xContext); |