Chromium Code Reviews| Index: components/spellcheck/renderer/spellcheck_provider.cc |
| diff --git a/components/spellcheck/renderer/spellcheck_provider.cc b/components/spellcheck/renderer/spellcheck_provider.cc |
| index f52fe596705c94e675d860375170502247e45779..4eb12f196d7359daaa0028dcfdb4cef7d646e14d 100644 |
| --- a/components/spellcheck/renderer/spellcheck_provider.cc |
| +++ b/components/spellcheck/renderer/spellcheck_provider.cc |
| @@ -329,17 +329,15 @@ bool SpellCheckProvider::SatisfyRequestFromCache( |
| if (start <= text_length && end <= text_length) |
| ++result_size; |
| } |
| - if (result_size > 0) { |
| - blink::WebVector<blink::WebTextCheckingResult> results(result_size); |
| - for (size_t i = 0; i < result_size; ++i) { |
| - results[i].decoration = last_results_[i].decoration; |
| - results[i].location = last_results_[i].location; |
| - results[i].length = last_results_[i].length; |
| - results[i].replacement = last_results_[i].replacement; |
| - } |
| - completion->didFinishCheckingText(results); |
| - return true; |
| + blink::WebVector<blink::WebTextCheckingResult> results(result_size); |
|
groby-ooo-7-16
2016/11/15 19:36:57
So, I might be misreading this, but it looks to me
timvolodine
2016/11/17 20:53:15
Yes much more compact indeed.
Done.
|
| + for (size_t i = 0; i < result_size; ++i) { |
| + results[i].decoration = last_results_[i].decoration; |
| + results[i].location = last_results_[i].location; |
| + results[i].length = last_results_[i].length; |
| + results[i].replacement = last_results_[i].replacement; |
| } |
| + completion->didFinishCheckingText(results); |
| + return true; |
|
groby-ooo-7-16
2016/11/15 19:36:57
I don't think this works as intended. SatisfyReque
timvolodine
2016/11/17 20:53:15
So currently a substring without misspellings will
|
| } |
| return false; |