Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7568)

Unified Diff: chrome/browser/renderer_context_menu/spelling_menu_observer.cc

Issue 2848943002: Allow storing multiple replacements on SpellCheckResult (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698