From ed0b12f4eadf1f2242f06cbd56804f75376274b1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 8 Nov 2024 12:00:27 +0200 Subject: 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 Tested-by: Jenkins --- svx/source/tbxctrls/PaletteManager.cxx | 2 +- svx/source/tbxctrls/fontworkgallery.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'svx/source/tbxctrls') diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 894d38808f84..426da02c94d8 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -444,7 +444,7 @@ void PaletteManager::DispatchColorCommand(const OUString& aCommand, const NamedC using namespace css::beans; using namespace css::util; - Reference xContext(comphelper::getProcessComponentContext()); + const Reference& xContext(comphelper::getProcessComponentContext()); Reference xDesktop = Desktop::create(xContext); Reference xFrame(xDesktop->getCurrentFrame()); Reference xDispatchProvider(xFrame, UNO_QUERY); diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 7cbf3479f4b5..746afd8a0400 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -195,7 +195,7 @@ void FontWorkGalleryDialog::insertSelectedFontwork() pPage->GetObj(0)->CloneSdrObject( bUseSpecialCalcMode ? *mpDestModel : mrSdrView.getSdrModelFromSdrView())); - Reference xContext = comphelper::getProcessComponentContext(); + const Reference& xContext = comphelper::getProcessComponentContext(); css::uno::Reference xModuleManager = css::frame::ModuleManager::create(xContext); OUString aModuleIdentifier = xModuleManager->identify(mxFrame); -- cgit