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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2906243002: Revert of Allow storing multiple replacements on SpellCheckResult (Closed)
Patch Set: Revert "Allow storing multiple replacements on SpellCheckResult" 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: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
index d08c0004b666e728eba26422a4dd7857bd06bea9..fadc5589c455c3d52914c97327959907893f469d 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -537,7 +537,7 @@ static void AddMarker(Document* document,
DocumentMarker::MarkerType type,
int location,
int length,
- const Vector<String>& descriptions) {
+ const String& description) {
DCHECK(type == DocumentMarker::kSpelling || type == DocumentMarker::kGrammar)
<< type;
DCHECK_GT(length, 0);
@@ -549,13 +549,6 @@ static void AddMarker(Document* document,
if (!SpellChecker::IsSpellCheckingEnabledAt(range_to_mark.EndPosition()))
return;
- String description;
- for (size_t i = 0; i < descriptions.size(); ++i) {
- if (i != 0)
- description.append('\n');
- description.append(descriptions[i]);
- }
-
if (type == DocumentMarker::kSpelling) {
document->Markers().AddSpellingMarker(range_to_mark.StartPosition(),
range_to_mark.EndPosition(),
@@ -651,7 +644,7 @@ void SpellChecker::MarkAndReplaceFor(
continue;
AddMarker(GetFrame().GetDocument(), paragraph.CheckingRange(),
DocumentMarker::kSpelling, result_location, result_length,
- result.replacements);
+ result.replacement);
continue;
case kTextDecorationTypeGrammar:
@@ -667,7 +660,7 @@ void SpellChecker::MarkAndReplaceFor(
continue;
AddMarker(GetFrame().GetDocument(), paragraph.CheckingRange(),
DocumentMarker::kGrammar, result_location + detail.location,
- detail.length, result.replacements);
+ detail.length, result.replacement);
}
continue;
}

Powered by Google App Engine
This is Rietveld 408576698