From 6b8df9d79f89242a503b93b3c9e9f279eeda2105 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Aug 2021 10:29:29 +0200 Subject: pAvailGrammarSvcs can never be null here Change-Id: Ib4de13bb513235d8f865f00a10920d11ca9c5763 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120272 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- linguistic/source/lngsvcmgr.cxx | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'linguistic/source') diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index a0f9822e4779..9e0100538809 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -1009,19 +1009,16 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl() : xFactory->createInstance(), uno::UNO_QUERY_THROW); - if (pAvailGrammarSvcs) - { - OUString aImplName; - std::vector< LanguageType > aLanguages; - uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); - if (xInfo.is()) - aImplName = xInfo->getImplementationName(); - SAL_WARN_IF( aImplName.isEmpty(), "linguistic", "empty implementation name" ); - uno::Sequence aLocaleSequence(xSvc->getLocales()); - aLanguages = LocaleSeqToLangVec( aLocaleSequence ); - - pAvailGrammarSvcs->push_back( std::make_unique( aImplName, aLanguages ) ); - } + OUString aImplName; + std::vector< LanguageType > aLanguages; + uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); + if (xInfo.is()) + aImplName = xInfo->getImplementationName(); + SAL_WARN_IF( aImplName.isEmpty(), "linguistic", "empty implementation name" ); + uno::Sequence aLocaleSequence(xSvc->getLocales()); + aLanguages = LocaleSeqToLangVec( aLocaleSequence ); + + pAvailGrammarSvcs->push_back( std::make_unique( aImplName, aLanguages ) ); } catch (const uno::Exception &) { -- cgit