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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 10 14:09:46 UTC 2018


 svx/source/dialog/langbox.cxx |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit f6ad6eedfd21bc8f9de09d53d3be883bbc543cc7
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Dec 10 11:09:14 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Dec 10 15:09:24 2018 +0100

    Resolves: tdf#121520 duplicate languages in dropdown
    
    Change-Id: I5bbde305bf06ac1f754f24eb93e89cb3d9cf6058
    Reviewed-on: https://gerrit.libreoffice.org/64866
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 242753913641..ba244f38e4f6 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -516,12 +516,15 @@ void LanguageBox::AddLanguages(const std::vector< LanguageType >& rLanguageTypes
             if (lcl_isScriptTypeRequested( nLang, nLangList))
             {
                 int nAt = ImplTypeToPos(nLang);
-                if (nAt == -1)
-                {
-                    rEntries.push_back(BuildEntry(nLang));
-                    if (rEntries.back().sString.isEmpty())
-                        rEntries.pop_back();
-                }
+                if (nAt != -1)
+                    continue;
+                weld::ComboBoxEntry aNewEntry(BuildEntry(nLang));
+                if (aNewEntry.sString.isEmpty())
+                    continue;
+                if (std::find_if(rEntries.begin(), rEntries.end(),
+                                 [=](const weld::ComboBoxEntry& rEntry){ return rEntry.sId == aNewEntry.sId; }) != rEntries.end())
+                    continue;
+                rEntries.push_back(aNewEntry);
             }
         }
     }


More information about the Libreoffice-commits mailing list