From 2f9f2bda98274baa5af7d2231a84cca0970f462c Mon Sep 17 00:00:00 2001 From: "sidchat@google.com" Date: Thu, 19 Mar 2009 18:06:20 +0000 Subject: Remove extra language under "Spell-checker options" context menu Issue=8127 Review URL: http://codereview.chromium.org/48082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12108 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/spellchecker.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'chrome/browser/spellchecker.cc') diff --git a/chrome/browser/spellchecker.cc b/chrome/browser/spellchecker.cc index 2ce324c..e1f428d 100644 --- a/chrome/browser/spellchecker.cc +++ b/chrome/browser/spellchecker.cc @@ -115,10 +115,17 @@ SpellChecker::Language SpellChecker::GetCorrespondingSpellCheckLanguage( // Look for exact match in the Spell Check language list. for (size_t i = 0; i < ARRAYSIZE_UNSAFE(g_supported_spellchecker_languages); ++i) { + // First look for exact match in the language region of the list. Language spellcheck_language( g_supported_spellchecker_languages[i].language); if (spellcheck_language == language) return language; + + // Next, look for exact match in the language_region part of the list. + Language spellcheck_language_region( + g_supported_spellchecker_languages[i].language_region); + if (spellcheck_language_region == language) + return g_supported_spellchecker_languages[i].language; } // Look for a match by comparing only language parts. All the 'en-RR' @@ -165,7 +172,7 @@ int SpellChecker::GetSpellCheckLanguagesToDisplayInContextMenu( for (Languages::const_iterator i = accept_languages.begin(); i != accept_languages.end(); ++i) { Language language(GetCorrespondingSpellCheckLanguage(*i)); - if (!language.empty()) + if (!language.empty() && language != WideToASCII(dictionary_language)) unique_languages.insert(language); } -- cgit v1.1