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 /sw/source/uibase/uiview | |
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 'sw/source/uibase/uiview')
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewling.cxx | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 0db453927af2..dfca448da361 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -2028,7 +2028,7 @@ OUString SwView::GetDataSourceName() const bool SwView::IsDataSourceAvailable(const OUString sDataSourceName) { - uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + const uno::Reference< uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() ); Reference< XDatabaseContext> xDatabaseContext = DatabaseContext::create(xContext); return xDatabaseContext->hasByName(sDataSourceName); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 0df8e979a356..f9acb11ba4ec 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -2970,7 +2970,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) if(!GetWrtShell().IsAnyDatabaseFieldInDoc()) { //check availability of data sources (except biblio source) - uno::Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); + const uno::Reference<XComponentContext>& xContext( ::comphelper::getProcessComponentContext() ); uno::Reference<XDatabaseContext> xDBContext = DatabaseContext::create(xContext); bool bCallAddressPilot = false; if ( lcl_NeedAdditionalDataSource( xDBContext ) ) diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 1089d1cc4f10..b3ec59e5768f 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -245,7 +245,7 @@ void SwView::StartTextConversion( const bool bOther = !bSelection && !(m_pWrtShell->GetFrameType(nullptr,true) & FrameTypeFlags::BODY); { - const uno::Reference< uno::XComponentContext > xContext( + const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() ); SwHHCWrapper aWrap( this, xContext, nSourceLang, nTargetLang, pTargetFont, nOptions, bIsInteractive, @@ -821,7 +821,7 @@ void SwView::ExecSmartTagPopup( const Point& rPt ) css::uno::Any(comphelper::makePropertyValue( u"CommandURL"_ustr, u".uno:OpenSmartTagMenuOnCursor"_ustr )) }; - css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + const css::uno::Reference< css::uno::XComponentContext >& xContext = comphelper::getProcessComponentContext(); css::uno::Reference< css::frame::XPopupMenuController > xPopupController( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( u"com.sun.star.comp.svx.SmartTagMenuController"_ustr, aArgs, xContext ), css::uno::UNO_QUERY ); |