include/svx/langbox.hxx | 1 - svx/source/dialog/langbox.cxx | 16 +++++----------- 2 files changed, 5 insertions(+), 12 deletions(-)
New commits: commit ee2d846031e9921c61ff1ff8399ed1fe9106c5fc Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Mon Jun 5 14:25:52 2023 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Jun 5 20:26:27 2023 +0200 Drop unneeded indirection Change-Id: Ie837aec7e2b4b87665cc98200d38329ec2155c56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152614 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx index 3cc724f52c7d..08893e8e1ce4 100644 --- a/include/svx/langbox.hxx +++ b/include/svx/langbox.hxx @@ -70,7 +70,6 @@ private: SVX_DLLPRIVATE weld::ComboBoxEntry BuildEntry(const LanguageType nLangType, sal_Int16 nType = css::i18n::ScriptType::WEAK); SVX_DLLPRIVATE void AddLanguages(const std::vector< LanguageType >& rLanguageTypes, SvxLanguageListFlags nLangList, std::vector<weld::ComboBoxEntry>& rEntries); - SVX_DLLPRIVATE void InsertLanguage(const LanguageType nLangType, sal_Int16 nType); DECL_DLLPRIVATE_LINK(ChangeHdl, weld::ComboBox&, void); public: diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 4135964daa29..459e7db31033 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -305,20 +305,14 @@ void SvxLanguageBox::SetLanguageList(SvxLanguageListFlags nLangList, bool bHasLa m_xControl->insert_vector(aEntries, true); } -void SvxLanguageBox::InsertLanguage(const LanguageType nLangType, sal_Int16 nType) +void SvxLanguageBox::InsertLanguage(const LanguageType nLangType) { - weld::ComboBoxEntry aEntry = BuildEntry(nLangType, nType); + if (find_id(nLangType) != -1) + return; + weld::ComboBoxEntry aEntry = BuildEntry(nLangType); if (aEntry.sString.isEmpty()) return; - if (aEntry.sImage.isEmpty()) - m_xControl->append(aEntry.sId, aEntry.sString); - else - m_xControl->append(aEntry.sId, aEntry.sString, aEntry.sImage); -} - -void SvxLanguageBox::InsertLanguage(const LanguageType nLangType) -{ - InsertLanguage(nLangType, css::i18n::ScriptType::WEAK); + m_xControl->append(aEntry); } weld::ComboBoxEntry SvxLanguageBox::BuildEntry(const LanguageType nLangType, sal_Int16 nType)