summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-11-08 12:00:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-11-08 15:23:52 +0100
commited0b12f4eadf1f2242f06cbd56804f75376274b1 (patch)
tree7028abd9cf514c74bd1b795cc6398b0bb433f319 /editeng/source
parent5ff283e3b841230a45715e48a251c3c4216d1cec (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 'editeng/source')
-rw-r--r--editeng/source/editeng/impedit3.cxx4
-rw-r--r--editeng/source/items/numitem.cxx2
-rw-r--r--editeng/source/misc/svxacorr.cxx8
-rw-r--r--editeng/source/misc/unolingu.cxx4
-rw-r--r--editeng/source/xml/xmltxtexp.cxx2
-rw-r--r--editeng/source/xml/xmltxtimp.cxx2
6 files changed, 11 insertions, 11 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 12289ba018ca..f74d7664d305 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4737,7 +4737,7 @@ Reference < i18n::XBreakIterator > const & ImpEditEngine::ImplGetBreakIterator()
{
if (!mxBI.is())
{
- uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
+ const uno::Reference<uno::XComponentContext>& xContext(::comphelper::getProcessComponentContext());
mxBI = i18n::BreakIterator::create(xContext);
}
return mxBI;
@@ -4747,7 +4747,7 @@ Reference < i18n::XExtendedInputSequenceChecker > const & ImpEditEngine::ImplGet
{
if (!mxISC.is())
{
- uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
+ const uno::Reference<uno::XComponentContext>& xContext(::comphelper::getProcessComponentContext());
mxISC = i18n::InputSequenceChecker::create(xContext);
}
return mxISC;
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index cd4a2e93146d..8f9f52966041 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -75,7 +75,7 @@ static void lcl_getFormatter(css::uno::Reference<css::text::XNumberingFormatter>
try
{
- Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
+ const Reference<XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
Reference<XDefaultNumberingProvider> xRet = text::DefaultNumberingProvider::create(xContext);
_xFormatter.set(xRet, UNO_QUERY);
}
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 0c3540051e49..1453f9f91921 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2350,7 +2350,7 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp(
}
else
{
- uno::Reference< uno::XComponentContext > xContext =
+ const uno::Reference< uno::XComponentContext >& xContext =
comphelper::getProcessComponentContext();
xml::sax::InputSource aParserInput;
@@ -2423,7 +2423,7 @@ void SvxAutoCorrectLanguageLists::SaveExceptList_Imp(
xStrm->SetProperty( u"MediaType"_ustr, Any(u"text/xml"_ustr) );
- uno::Reference< uno::XComponentContext > xContext =
+ const uno::Reference< uno::XComponentContext >& xContext =
comphelper::getProcessComponentContext();
uno::Reference < xml::sax::XWriter > xWriter = xml::sax::Writer::create(xContext);
@@ -2464,7 +2464,7 @@ SvxAutocorrWordList* SvxAutoCorrectLanguageLists::LoadAutocorrWordList()
{
uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetStorageFromURL( sShareAutoCorrFile, embed::ElementModes::READ );
uno::Reference < io::XStream > xStrm = xStg->openStreamElement( pXMLImplAutocorr_ListStr, embed::ElementModes::READ );
- uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ const uno::Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext();
xml::sax::InputSource aParserInput;
aParserInput.sSystemId = pXMLImplAutocorr_ListStr;
@@ -2763,7 +2763,7 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
refList->SetBufferSize( 8192 );
refList->SetProperty( u"MediaType"_ustr, Any(u"text/xml"_ustr) );
- uno::Reference< uno::XComponentContext > xContext =
+ const uno::Reference< uno::XComponentContext >& xContext =
comphelper::getProcessComponentContext();
uno::Reference < xml::sax::XWriter > xWriter = xml::sax::Writer::create(xContext);
diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx
index bb256e0bba60..aa21b592edbe 100644
--- a/editeng/source/misc/unolingu.cxx
+++ b/editeng/source/misc/unolingu.cxx
@@ -56,7 +56,7 @@ using namespace ::com::sun::star::linguistic2;
static uno::Reference< XLinguServiceManager2 > GetLngSvcMgr_Impl()
{
- uno::Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
+ const uno::Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext();
uno::Reference< XLinguServiceManager2 > xRes = LinguServiceManager::create(xContext);
return xRes;
}
@@ -402,7 +402,7 @@ LinguMgrExitLstnr::LinguMgrExitLstnr()
// add object to frame::Desktop EventListeners in order to properly call
// the AtExit function at application exit.
- uno::Reference< XComponentContext > xContext = getProcessComponentContext();
+ const uno::Reference< XComponentContext >& xContext = getProcessComponentContext();
xDesktop = Desktop::create( xContext );
xDesktop->addEventListener( this );
}
diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx
index 083e868bd34d..feab612a9d9d 100644
--- a/editeng/source/xml/xmltxtexp.cxx
+++ b/editeng/source/xml/xmltxtexp.cxx
@@ -291,7 +291,7 @@ void SvxWriteXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection&
do
{
// create service factory
- uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
+ const uno::Reference<uno::XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
// create document handler
uno::Reference< xml::sax::XWriter > xWriter = xml::sax::Writer::create( xContext );
diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx
index 8e32d8f62045..ba2c8ba5002d 100644
--- a/editeng/source/xml/xmltxtimp.cxx
+++ b/editeng/source/xml/xmltxtimp.cxx
@@ -162,7 +162,7 @@ EditPaM SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection
{
do
{
- uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
+ const uno::Reference<uno::XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
xml::sax::InputSource aParserInput;
aParserInput.aInputStream = new utl::OInputStreamWrapper(rStream);