summaryrefslogtreecommitdiff
path: root/linguistic/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 /linguistic/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 'linguistic/source')
-rw-r--r--linguistic/source/convdic.cxx4
-rw-r--r--linguistic/source/dicimp.cxx6
-rw-r--r--linguistic/source/dlistimp.cxx2
-rw-r--r--linguistic/source/gciterator.cxx6
-rw-r--r--linguistic/source/hyphdsp.cxx6
-rw-r--r--linguistic/source/lngsvcmgr.cxx12
-rw-r--r--linguistic/source/misc.cxx4
-rw-r--r--linguistic/source/misc2.cxx2
-rw-r--r--linguistic/source/spelldsp.cxx4
-rw-r--r--linguistic/source/thesdsp.cxx2
10 files changed, 24 insertions, 24 deletions
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index ac1f7436e572..db5474246e20 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -68,7 +68,7 @@ static void ReadThroughDic( const OUString &rMainURL, ConvDicXMLImport &rImport
return;
DBG_ASSERT(!INetURLObject( rMainURL ).HasError(), "invalid URL");
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get xInputStream stream
uno::Reference< io::XInputStream > xIn;
@@ -207,7 +207,7 @@ void ConvDic::Save()
return;
DBG_ASSERT(!INetURLObject( aMainURL ).HasError(), "invalid URL");
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get XOutputStream stream
uno::Reference< io::XStream > xStream;
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 6bcda95bbc10..9c243c794933 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -88,7 +88,7 @@ const sal_Int16 DIC_VERSION_7 = 7;
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;
}
@@ -273,7 +273,7 @@ ErrCode DictionaryNeo::loadEntries(const OUString &rMainURL)
if (rMainURL.isEmpty())
return ERRCODE_NONE;
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get XInputStream stream
uno::Reference< io::XInputStream > xStream;
@@ -407,7 +407,7 @@ ErrCode DictionaryNeo::saveEntries(const OUString &rURL)
return ERRCODE_NONE;
DBG_ASSERT(!INetURLObject( rURL ).HasError(), "lng : invalid URL");
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get XOutputStream stream
uno::Reference<io::XStream> xStream;
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index fe8b2e2a878c..dd436233de04 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -761,7 +761,7 @@ static bool IsVers2OrNewer( const OUString& rFileURL, LanguageType& nLng, bool&
return false;
// get stream to be used
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
// get XInputStream stream
uno::Reference< io::XInputStream > xStream;
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 36bcdcc72119..ab6d665af771 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -564,7 +564,7 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC
{
try
{
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< linguistic2::XProofreader > xGC(
xContext->getServiceManager()->createInstanceWithContext(aSvcImplName, xContext),
uno::UNO_QUERY_THROW );
@@ -883,7 +883,7 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence(
if (!m_xBreakIterator.is())
{
- uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ const uno::Reference< uno::XComponentContext >& xContext = ::comphelper::getProcessComponentContext();
m_xBreakIterator = i18n::BreakIterator::create(xContext);
}
sal_Int32 nTextLen = rText.getLength();
@@ -1095,7 +1095,7 @@ uno::Reference< util::XChangesBatch > const & GrammarCheckingIterator::GetUpdate
try
{
// get configuration provider
- uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ const uno::Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext();
uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider =
configuration::theDefaultProvider::get( xContext );
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index 677fe74f9ff4..ee45990351bc 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -345,7 +345,7 @@ Reference< XHyphenatedWord > SAL_CALL
{
Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray();
- Reference< XComponentContext > xContext(
+ const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument
@@ -477,7 +477,7 @@ Reference< XHyphenatedWord > SAL_CALL
{
Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray();
- Reference< XComponentContext > xContext(
+ const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument
@@ -599,7 +599,7 @@ Reference< XPossibleHyphens > SAL_CALL
{
Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray();
- Reference< XComponentContext > xContext(
+ const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 71eae948e3a4..607a60cb281f 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -70,7 +70,7 @@ static uno::Sequence< lang::Locale > GetAvailLocales(
{
uno::Sequence< lang::Locale > aRes;
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
if( rSvcImplNames.hasElements() )
{
std::set< LanguageType > aLanguages;
@@ -417,7 +417,7 @@ LngSvcMgr::LngSvcMgr()
aUpdateIdle.SetInvokeHandler(LINK(this, LngSvcMgr, updateAndBroadcast));
// request to be notified if an extension has been added/removed
- uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
+ const uno::Reference<uno::XComponentContext>& xContext(comphelper::getProcessComponentContext());
uno::Reference<deployment::XExtensionManager> xExtensionManager;
try {
@@ -935,7 +935,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl()
pAvailSpellSvcs.emplace();
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
@@ -989,7 +989,7 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
pAvailGrammarSvcs.emplace();
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
@@ -1047,7 +1047,7 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl()
return;
pAvailHyphSvcs.emplace();
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
@@ -1099,7 +1099,7 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl()
pAvailThesSvcs.emplace();
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
uno::Reference< container::XEnumeration > xEnum;
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 87e9fa397b9b..088cde001f20 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -672,7 +672,7 @@ uno::Reference< XLinguProperties > GetLinguProperties()
uno::Reference< XSearchableDictionaryList > GetDictionaryList()
{
- uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
uno::Reference< XSearchableDictionaryList > xRef;
try
{
@@ -705,7 +705,7 @@ AppExitListener::AppExitListener()
{
// add object to Desktop EventListeners in order to properly call
// the AtExit function at application exit.
- uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< XComponentContext >& xContext( comphelper::getProcessComponentContext() );
try
{
diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx
index 86a81e5a1f06..6464a0cbce74 100644
--- a/linguistic/source/misc2.cxx
+++ b/linguistic/source/misc2.cxx
@@ -86,7 +86,7 @@ static std::vector< OUString > GetMultiPaths_Impl(
OUString aWritablePath;
bool bSuccess = true;
- uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ const uno::Reference< uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() );
try
{
OUString aInternal( OUString::Concat(rPathPrefix) + "_internal" );
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index 32bdb21803d1..612ed2bc04a8 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -341,7 +341,7 @@ bool SpellCheckerDispatcher::isValid_Impl(
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
Reference< XSpellChecker > *pRef = pEntry->aSvcRefs .getArray();
- Reference< XComponentContext > xContext(
+ const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument
@@ -522,7 +522,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
Reference< XSpellChecker > *pRef = pEntry->aSvcRefs .getArray();
- Reference< XComponentContext > xContext(
+ const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument
diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx
index f4c21bfdf524..ced14c22a6d2 100644
--- a/linguistic/source/thesdsp.cxx
+++ b/linguistic/source/thesdsp.cxx
@@ -144,7 +144,7 @@ Sequence< Reference< XMeaning > > SAL_CALL
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
Reference< XThesaurus > *pRef = pEntry->aSvcRefs.getArray();
- Reference< XComponentContext > xContext(
+ const Reference< XComponentContext >& xContext(
comphelper::getProcessComponentContext() );
// build service initialization argument