diff options
author | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 18:06:20 +0000 |
---|---|---|
committer | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-19 18:06:20 +0000 |
commit | 2f9f2bda98274baa5af7d2231a84cca0970f462c (patch) | |
tree | 5c007983e2b3e2f3c58c60dfbec8f346b3500fe4 /chrome/browser/spellchecker.cc | |
parent | dd25c30b5f73cf66623436b152ec10fdc73f65a2 (diff) | |
download | chromium_src-2f9f2bda98274baa5af7d2231a84cca0970f462c.zip chromium_src-2f9f2bda98274baa5af7d2231a84cca0970f462c.tar.gz chromium_src-2f9f2bda98274baa5af7d2231a84cca0970f462c.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/spellchecker.cc')
-rw-r--r-- | chrome/browser/spellchecker.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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); } |