summaryrefslogtreecommitdiffstats
path: root/chrome/browser/spellchecker.cc
diff options
context:
space:
mode:
authorsidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 23:20:35 +0000
committersidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 23:20:35 +0000
commit75d69a0d6ae1ecbfdc2eed35d1542af89ed2e069 (patch)
treeda05590353edde6b31e9c198061acd84a33f6081 /chrome/browser/spellchecker.cc
parentbc805ebea0d8c78475d1a34bd13cc44aa7da9459 (diff)
downloadchromium_src-75d69a0d6ae1ecbfdc2eed35d1542af89ed2e069.zip
chromium_src-75d69a0d6ae1ecbfdc2eed35d1542af89ed2e069.tar.gz
chromium_src-75d69a0d6ae1ecbfdc2eed35d1542af89ed2e069.tar.bz2
Do not autocorrect words in capital letters, or having capital letters in between, as they may refer to acronyms or terms not in the dictionary.
BUG = www.crbug.com/12921 TEST = Type CLD (a library), should not change back to LCD Review URL: http://codereview.chromium.org/118008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17259 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/spellchecker.cc')
-rw-r--r--chrome/browser/spellchecker.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/spellchecker.cc b/chrome/browser/spellchecker.cc
index 68643b5..d185019 100644
--- a/chrome/browser/spellchecker.cc
+++ b/chrome/browser/spellchecker.cc
@@ -486,6 +486,10 @@ void SpellChecker::GetAutoCorrectionWord(const std::wstring& word,
wchar_t misspelled_word[kMaxAutoCorrectWordSize + 1];
const wchar_t* word_char = word.c_str();
for (int i = 0; i <= kMaxAutoCorrectWordSize; i++) {
+ // Ignore words having uppercase letter, other that the first letter.
+ if (i > 0 && u_isupper(word_char[i]))
+ return;
+
if (i >= word_length)
misspelled_word[i] = NULL;
else