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

Unified Diff: third_party/WebKit/Source/core/exported/WebTextCheckingResult.cpp

Issue 2911253003: [Reland] 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: third_party/WebKit/Source/core/exported/WebTextCheckingResult.cpp
diff --git a/third_party/WebKit/Source/core/exported/WebTextCheckingResult.cpp b/third_party/WebKit/Source/core/exported/WebTextCheckingResult.cpp
index fa6ff49af3d324623bb2babf3786174c559e6073..7e211d6994ea2dca6646794a902432707cd7d2ec 100644
--- a/third_party/WebKit/Source/core/exported/WebTextCheckingResult.cpp
+++ b/third_party/WebKit/Source/core/exported/WebTextCheckingResult.cpp
@@ -39,12 +39,19 @@ WebTextCheckingResult::operator TextCheckingResult() const {
result.decoration = static_cast<TextDecorationType>(decoration);
result.location = location;
result.length = length;
- result.replacement = replacement;
+
+ // Convert from WebVector to Vector
+ Vector<String> replacements_vector;
+ for (const WebString& replacement : replacements) {
+ replacements_vector.push_back(replacement);
+ }
+ result.replacements = replacements_vector;
+
if (result.decoration == kTextDecorationTypeGrammar) {
GrammarDetail detail;
detail.location = 0;
detail.length = length;
- detail.user_description = replacement;
+ detail.user_description = replacements.empty() ? "" : replacements[0];
result.details.push_back(detail);
}

Powered by Google App Engine
This is Rietveld 408576698