[Libreoffice-commits] core.git: linguistic/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 10 15:14:35 UTC 2021


 linguistic/source/lngsvcmgr.cxx |   23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 6b8df9d79f89242a503b93b3c9e9f279eeda2105
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Aug 10 10:29:29 2021 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Aug 10 17:13:58 2021 +0200

    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 at redhat.com>

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 &)
             {


More information about the Libreoffice-commits mailing list