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

Side by Side Diff: third_party/WebKit/Source/web/WebTextCheckingResult.cpp

Issue 2848943002: Allow storing multiple replacements on SpellCheckResult (Closed)
Patch Set: Rebase Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 21 matching lines...) Expand all
32 32
33 #include "platform/text/TextCheckerClient.h" 33 #include "platform/text/TextCheckerClient.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 WebTextCheckingResult::operator TextCheckingResult() const { 37 WebTextCheckingResult::operator TextCheckingResult() const {
38 TextCheckingResult result; 38 TextCheckingResult result;
39 result.decoration = static_cast<TextDecorationType>(decoration); 39 result.decoration = static_cast<TextDecorationType>(decoration);
40 result.location = location; 40 result.location = location;
41 result.length = length; 41 result.length = length;
42 result.replacement = replacement; 42
43 Vector<String> replacements_vec;
44 for (const WebString& replacement : replacements) {
45 replacements_vec.push_back(replacement);
46 }
47 result.replacements = replacements_vec;
48
43 if (result.decoration == kTextDecorationTypeGrammar) { 49 if (result.decoration == kTextDecorationTypeGrammar) {
44 GrammarDetail detail; 50 GrammarDetail detail;
45 detail.location = 0; 51 detail.location = 0;
46 detail.length = length; 52 detail.length = length;
47 detail.user_description = replacement; 53 detail.user_description = replacements.empty() ? "" : replacements[0];
48 result.details.push_back(detail); 54 result.details.push_back(detail);
49 } 55 }
50 56
51 return result; 57 return result;
52 } 58 }
53 59
54 } // namespace blink 60 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698