Index: chrome/browser/renderer_context_menu/spelling_menu_observer.cc |
diff --git a/chrome/browser/renderer_context_menu/spelling_menu_observer.cc b/chrome/browser/renderer_context_menu/spelling_menu_observer.cc |
index 355d84d5ce14b8fdd94c155452a86bbbabea9ca1..61de0fd269bdfacb749e67f4f96d2eddd8a5b891 100644 |
--- a/chrome/browser/renderer_context_menu/spelling_menu_observer.cc |
+++ b/chrome/browser/renderer_context_menu/spelling_menu_observer.cc |
@@ -315,7 +315,9 @@ void SpellingMenuObserver::OnTextCheckComplete( |
typedef std::vector<SpellCheckResult> SpellCheckResults; |
for (SpellCheckResults::const_iterator it = results.begin(); |
it != results.end(); ++it) { |
- result_.replace(it->location, it->length, it->replacement); |
+ // If there's more than one replacement, we can't automatically apply it |
+ if (it->replacements.size() == 1) |
+ result_.replace(it->location, it->length, it->replacements[0]); |
} |
base::string16 result = base::i18n::ToLower(result_); |
for (std::vector<base::string16>::const_iterator it = suggestions_.begin(); |