diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-08-10 10:29:29 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-08-10 17:13:58 +0200 |
commit | 6b8df9d79f89242a503b93b3c9e9f279eeda2105 (patch) | |
tree | 9f46de262a769e5ead22b79944517b0fde18dd67 /linguistic/source | |
parent | c23730471c487b8f01eddfa3845b49316c0db94d (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'linguistic/source')
-rw-r--r-- | linguistic/source/lngsvcmgr.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
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<lang::Locale> aLocaleSequence(xSvc->getLocales()); - aLanguages = LocaleSeqToLangVec( aLocaleSequence ); - - pAvailGrammarSvcs->push_back( std::make_unique<SvcInfo>( 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<lang::Locale> aLocaleSequence(xSvc->getLocales()); + aLanguages = LocaleSeqToLangVec( aLocaleSequence ); + + pAvailGrammarSvcs->push_back( std::make_unique<SvcInfo>( aImplName, aLanguages ) ); } catch (const uno::Exception &) { |