Related: tdf#152781 Add also non-on-the-fly IDs to language list

Generating names more than once is unnecessary.
This may happen for defined mappings that have no explicitly
predefined language list entry.

Change-Id: I278e6d77181b661a90d0fb133cb3ca30c2a9b721
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145049
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 0341e549..0f5f152 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -243,10 +243,8 @@ OUString SvtLanguageTableImpl::GetString( const LanguageType eType ) const
        << " with unknown name, so returning generated: "
        << sLangTag);

    // And add it to the table if it is an on-the-fly-id, which it usually is,
    // so it is available in all subsequent language boxes.
    if (LanguageTag::isOnTheFlyID( nLang))
        const_cast<SvtLanguageTableImpl*>(this)->AddEntry( sLangTag, nLang);
    // And add it to the table, so it is available in all subsequent language boxes.
    const_cast<SvtLanguageTableImpl*>(this)->AddEntry( sLangTag, nLang);

    return sLangTag;
}