summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-06-05 14:25:52 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-06-05 20:26:27 +0200
commitee2d846031e9921c61ff1ff8399ed1fe9106c5fc (patch)
treea74974c96fc9a5ee7bc72bcdbe4a4880dfa101df
parent496bd45f1e2f4c3dc90448d1adc81c5c29349f58 (diff)
Drop unneeded indirection
Change-Id: Ie837aec7e2b4b87665cc98200d38329ec2155c56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152614 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--include/svx/langbox.hxx1
-rw-r--r--svx/source/dialog/langbox.cxx16
2 files changed, 5 insertions, 12 deletions
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)