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/ui/docshell | |
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/ui/docshell')
-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 |
3 files changed, 4 insertions, 4 deletions
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))); |