From fcb8df3bcf551fc3437e6c7c8ddb24dc5a09db02 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 4 Nov 2015 14:16:19 +0200 Subject: use uno::Reference::set method instead of assignment Change-Id: I11822c50fa66d038a3d6f38054ab35c2e613f077 --- linguistic/source/gciterator.cxx | 2 +- linguistic/source/hyphdsp.cxx | 7 +++---- linguistic/source/lngsvcmgr.cxx | 17 ++++++++--------- linguistic/source/spelldsp.cxx | 6 ++---- linguistic/source/thesdsp.cxx | 3 +-- 5 files changed, 15 insertions(+), 20 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index eb6f90a45555..f6f6dc2cc157 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -1005,7 +1005,7 @@ uno::Reference< util::XChangesBatch > GrammarCheckingIterator::GetUpdateAccess() aValue.Value = uno::makeAny( OUString("org.openoffice.Office.Linguistic/ServiceManager") ); uno::Sequence< uno::Any > aProps(1); aProps[0] <<= aValue; - m_xUpdateAccess = uno::Reference< util::XChangesBatch >( + m_xUpdateAccess.set( xConfigurationProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationUpdateAccess", aProps ), uno::UNO_QUERY_THROW ); diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index ae0da9935c13..7f23cd6b7978 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -617,10 +617,9 @@ Reference< XPossibleHyphens > SAL_CALL // create specific service via it's implementation name try { - xHyph = Reference< XHyphenator >( - xContext->getServiceManager()->createInstanceWithArgumentsAndContext( - pEntry->aSvcImplNames[0], aArgs, xContext ), - UNO_QUERY ); + xHyph.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( + pEntry->aSvcImplNames[0], aArgs, xContext ), + UNO_QUERY ); } catch (uno::Exception &) { diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 75fda0ea6429..742544af131a 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -97,10 +97,9 @@ static uno::Sequence< lang::Locale > GetAvailLocales( uno::Reference< linguistic2::XSupportedLocales > xSuppLoc; try { - xSuppLoc = uno::Reference< linguistic2::XSupportedLocales >( - xContext->getServiceManager()->createInstanceWithArgumentsAndContext( - pImplNames[i], aArgs, xContext ), - uno::UNO_QUERY ); + xSuppLoc.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( + pImplNames[i], aArgs, xContext ), + uno::UNO_QUERY ); } catch (uno::Exception &) { @@ -490,7 +489,7 @@ LngSvcMgr::LngSvcMgr() } if (xExtensionManager.is()) { - xMB = uno::Reference(xExtensionManager, uno::UNO_QUERY_THROW); + xMB.set(xExtensionManager, uno::UNO_QUERY_THROW); uno::Reference xListener(this); xMB->addModifyListener( xListener ); @@ -1068,7 +1067,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl() { try { - xSvc = uno::Reference< linguistic2::XSpellChecker >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY ); + xSvc.set( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY ); } catch (const uno::Exception &) { @@ -1130,7 +1129,7 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl() { try { - xSvc = uno::Reference< linguistic2::XProofreader >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY ); + xSvc.set( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY ); } catch (const uno::Exception &) { @@ -1192,7 +1191,7 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl() { try { - xSvc = uno::Reference< linguistic2::XHyphenator >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY ); + xSvc.set( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY ); } catch (const uno::Exception &) { @@ -1253,7 +1252,7 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl() { try { - xSvc = uno::Reference< linguistic2::XThesaurus >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY ); + xSvc.set( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY ); } catch (const uno::Exception &) { diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index e77fd3063d38..745e0a900404 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -371,8 +371,7 @@ bool SpellCheckerDispatcher::isValid_Impl( Reference< XSpellChecker > xSpell; try { - xSpell = Reference< XSpellChecker >( - xContext->getServiceManager()->createInstanceWithArgumentsAndContext( + xSpell.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( pImplNames[i], aArgs, xContext ), UNO_QUERY ); } @@ -557,8 +556,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( Reference< XSpellChecker > xSpell; try { - xSpell = Reference< XSpellChecker >( - xContext->getServiceManager()->createInstanceWithArgumentsAndContext( + xSpell.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( pImplNames[i], aArgs, xContext ), UNO_QUERY ); } diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index a0027a10c5cf..8676318f0c23 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -171,8 +171,7 @@ Sequence< Reference< XMeaning > > SAL_CALL Reference< XThesaurus > xThes; try { - xThes = Reference< XThesaurus >( - xContext->getServiceManager()->createInstanceWithArgumentsAndContext( + xThes.set( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( pImplNames[i], aArgs, xContext ), UNO_QUERY ); } -- cgit