diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 20:07:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 07:55:53 +0200 |
commit | defdd8bebe40b48d8abc4d893ac9a82b550c5d19 (patch) | |
tree | 78f811275874463fa320f0e3db6a19987f2c1bd0 /linguistic | |
parent | 952b806c22f798977f5478dd630131acf1a5f068 (diff) |
loplugin:referencecasting in linguistic
Change-Id: Iff53942bebb1481666ae4469e16089d54669954f
Reviewed-on: https://gerrit.libreoffice.org/75973
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/convdic.cxx | 3 | ||||
-rw-r--r-- | linguistic/source/convdiclist.cxx | 8 | ||||
-rw-r--r-- | linguistic/source/dlistimp.cxx | 7 | ||||
-rw-r--r-- | linguistic/source/gciterator.cxx | 4 | ||||
-rw-r--r-- | linguistic/source/lngsvcmgr.cxx | 35 | ||||
-rw-r--r-- | linguistic/source/misc.cxx | 2 | ||||
-rw-r--r-- | linguistic/source/spelldta.cxx | 2 |
7 files changed, 20 insertions, 41 deletions
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 7c2c602a79fa..482ae2f2c880 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -257,8 +257,7 @@ void ConvDic::Save() xSaxWriter->setOutputStream( xStream->getOutputStream() ); // prepare arguments (prepend doc handler to given arguments) - uno::Reference< xml::sax::XDocumentHandler > xDocHandler( xSaxWriter, UNO_QUERY ); - rtl::Reference<ConvDicXMLExport> pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler ); + rtl::Reference<ConvDicXMLExport> pExport = new ConvDicXMLExport( *this, aMainURL, xSaxWriter ); bool bRet = pExport->Export(); // write entries to file DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" ); if (bRet) diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 50f1799423d2..da4236dc610c 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -391,10 +391,10 @@ ConvDicNameContainer & ConvDicList::GetNameContainer() // since there is no UI to active/deactivate the dictionaries // for chinese text conversion they should be activated by default - uno::Reference< XConversionDictionary > xS2TDic( - mxNameContainer->GetByName( "ChineseS2T" ), UNO_QUERY ); - uno::Reference< XConversionDictionary > xT2SDic( - mxNameContainer->GetByName( "ChineseT2S" ), UNO_QUERY ); + uno::Reference< XConversionDictionary > xS2TDic = + mxNameContainer->GetByName( "ChineseS2T" ); + uno::Reference< XConversionDictionary > xT2SDic = + mxNameContainer->GetByName( "ChineseT2S" ); if (xS2TDic.is()) xS2TDic->setActive( true ); if (xT2SDic.is()) diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 115fdca74669..e9b5da8d4e95 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -156,10 +156,9 @@ void SAL_CALL DicEvtListenerHelper::processDictionaryEvent( // assert that there is a corresponding dictionary entry if one was // added or deleted - uno::Reference< XDictionaryEntry > xDicEntry( rDicEvent.xDictionaryEntry, UNO_QUERY ); DBG_ASSERT( !(rDicEvent.nEvent & (DictionaryEventFlags::ADD_ENTRY | DictionaryEventFlags::DEL_ENTRY)) - || xDicEntry.is(), + || rDicEvent.xDictionaryEntry.is(), "lng : missing dictionary entry" ); // evaluate DictionaryEvents and update data for next DictionaryListEvent @@ -167,11 +166,11 @@ void SAL_CALL DicEvtListenerHelper::processDictionaryEvent( DBG_ASSERT(eDicType != DictionaryType_MIXED, "lng : unexpected dictionary type"); if ((rDicEvent.nEvent & DictionaryEventFlags::ADD_ENTRY) && xDic->isActive()) - nCondensedEvt |= xDicEntry->isNegative() ? + nCondensedEvt |= rDicEvent.xDictionaryEntry->isNegative() ? DictionaryListEventFlags::ADD_NEG_ENTRY : DictionaryListEventFlags::ADD_POS_ENTRY; if ((rDicEvent.nEvent & DictionaryEventFlags::DEL_ENTRY) && xDic->isActive()) - nCondensedEvt |= xDicEntry->isNegative() ? + nCondensedEvt |= rDicEvent.xDictionaryEntry->isNegative() ? DictionaryListEventFlags::DEL_NEG_ENTRY : DictionaryListEventFlags::DEL_POS_ENTRY; if ((rDicEvent.nEvent & DictionaryEventFlags::ENTRIES_CLEARED) && xDic->isActive()) diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 9c8aed2a49a7..43ee3ca21ffd 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -624,8 +624,8 @@ void GrammarCheckingIterator::DequeueAndCheck() || nSuggestedEnd > nStartPos, "nSuggestedEndOfSentencePos calculation failed?"); - uno::Reference<linguistic2::XProofreader> xGC( - GetGrammarChecker(aCurLocale), uno::UNO_QUERY); + uno::Reference<linguistic2::XProofreader> xGC = + GetGrammarChecker(aCurLocale); if (xGC.is()) { aGuard.clear(); diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 2f87177c2f1a..2ecb7ba7387d 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -1014,12 +1014,8 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl() if (xInfo.is()) aImplName = xInfo->getImplementationName(); SAL_WARN_IF( aImplName.isEmpty(), "linguistic", "empty implementation name" ); - uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY ); - SAL_WARN_IF( !xSuppLoc.is(), "linguistic", "interfaces not supported" ); - if (xSuppLoc.is()) { - uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales()); - aLanguages = LocaleSeqToLangVec( aLocaleSequence ); - } + uno::Sequence<lang::Locale> aLocaleSequence(xSvc->getLocales()); + aLanguages = LocaleSeqToLangVec( aLocaleSequence ); pAvailSpellSvcs->push_back( std::make_unique<SvcInfo>( aImplName, aLanguages ) ); } @@ -1076,13 +1072,8 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl() if (xInfo.is()) aImplName = xInfo->getImplementationName(); SAL_WARN_IF( aImplName.isEmpty(), "linguistic", "empty implementation name" ); - uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY ); - SAL_WARN_IF( !xSuppLoc.is(), "linguistic", "interfaces not supported" ); - if (xSuppLoc.is()) - { - uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales()); - aLanguages = LocaleSeqToLangVec( aLocaleSequence ); - } + uno::Sequence<lang::Locale> aLocaleSequence(xSvc->getLocales()); + aLanguages = LocaleSeqToLangVec( aLocaleSequence ); pAvailGrammarSvcs->push_back( std::make_unique<SvcInfo>( aImplName, aLanguages ) ); } @@ -1137,13 +1128,8 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl() if (xInfo.is()) aImplName = xInfo->getImplementationName(); SAL_WARN_IF( aImplName.isEmpty(), "linguistic", "empty implementation name" ); - uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY ); - SAL_WARN_IF( !xSuppLoc.is(), "linguistic", "interfaces not supported" ); - if (xSuppLoc.is()) - { - uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales()); - aLanguages = LocaleSeqToLangVec( aLocaleSequence ); - } + uno::Sequence<lang::Locale> aLocaleSequence(xSvc->getLocales()); + aLanguages = LocaleSeqToLangVec( aLocaleSequence ); pAvailHyphSvcs->push_back( std::make_unique<SvcInfo>( aImplName, aLanguages ) ); } } @@ -1198,13 +1184,8 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl() if (xInfo.is()) aImplName = xInfo->getImplementationName(); SAL_WARN_IF( aImplName.isEmpty(), "linguistic", "empty implementation name" ); - uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY ); - SAL_WARN_IF( !xSuppLoc.is(), "linguistic", "interfaces not supported" ); - if (xSuppLoc.is()) - { - uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales()); - aLanguages = LocaleSeqToLangVec( aLocaleSequence ); - } + uno::Sequence<lang::Locale> aLocaleSequence(xSvc->getLocales()); + aLanguages = LocaleSeqToLangVec( aLocaleSequence ); pAvailThesSvcs->push_back( std::make_unique<SvcInfo>( aImplName, aLanguages ) ); } diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 29ad163ca912..61dc3506aa68 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -282,7 +282,7 @@ uno::Reference< XDictionaryEntry > SearchDicList( sal_Int32 i; for (i = 0; i < nDics; i++) { - uno::Reference< XDictionary > axDic( pDic[i], UNO_QUERY ); + uno::Reference< XDictionary > axDic = pDic[i]; DictionaryType eType = axDic->getDictionaryType(); LanguageType nLang = LinguLocaleToLanguage( axDic->getLocale() ); diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index da7818d9acaf..8b29c334f12b 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -74,7 +74,7 @@ void SearchSimilarText( const OUString &rText, LanguageType nLanguage, for (sal_Int32 i = 0; i < nDics; i++) { - Reference< XDictionary > xDic( pDic[i], UNO_QUERY ); + Reference< XDictionary > xDic = pDic[i]; LanguageType nLang = LinguLocaleToLanguage( xDic->getLocale() ); |