| Index: third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
|
| index 7ba54bf4aacd1a37851e81d99304929ca4abce93..975ef0a42c2d0f941cf90431ae893d3d53da2760 100644
|
| --- a/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
|
| @@ -365,8 +365,7 @@ String TextCheckingHelper::findFirstMisspellingOrBadGrammar(bool& outIsSpelling,
|
| unsigned grammarDetailIndex = 0;
|
|
|
| Vector<TextCheckingResult> results;
|
| - TextCheckingTypeMask checkingTypes = TextCheckingTypeSpelling | TextCheckingTypeGrammar;
|
| - checkTextOfParagraph(m_client->textChecker(), paragraphString, checkingTypes, results);
|
| + checkTextOfParagraph(m_client->textChecker(), paragraphString, results);
|
|
|
| for (unsigned i = 0; i < results.size(); i++) {
|
| const TextCheckingResult* result = &results[i];
|
| @@ -554,28 +553,25 @@ bool TextCheckingHelper::unifiedTextCheckerEnabled() const
|
| return blink::unifiedTextCheckerEnabled(doc.frame());
|
| }
|
|
|
| -void checkTextOfParagraph(TextCheckerClient& client, const String& text, TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results)
|
| +void checkTextOfParagraph(TextCheckerClient& client, const String& text, Vector<TextCheckingResult>& results)
|
| {
|
| Vector<UChar> characters;
|
| text.appendTo(characters);
|
| unsigned length = text.length();
|
|
|
| Vector<TextCheckingResult> spellingResult;
|
| - if (checkingTypes & TextCheckingTypeSpelling)
|
| - findMisspellings(client, characters.data(), 0, length, spellingResult);
|
| + findMisspellings(client, characters.data(), 0, length, spellingResult);
|
|
|
| - Vector<TextCheckingResult> grammarResult;
|
| - if (checkingTypes & TextCheckingTypeGrammar) {
|
| - // Only checks grammartical error before the first misspellings
|
| - int grammarCheckLength = length;
|
| - for (const auto& spelling : spellingResult) {
|
| - if (spelling.location < grammarCheckLength)
|
| - grammarCheckLength = spelling.location;
|
| - }
|
| -
|
| - findBadGrammars(client, characters.data(), 0, grammarCheckLength, grammarResult);
|
| + // Only checks grammartical error before the first misspellings
|
| + int grammarCheckLength = length;
|
| + for (const auto& spelling : spellingResult) {
|
| + if (spelling.location < grammarCheckLength)
|
| + grammarCheckLength = spelling.location;
|
| }
|
|
|
| + Vector<TextCheckingResult> grammarResult;
|
| + findBadGrammars(client, characters.data(), 0, grammarCheckLength, grammarResult);
|
| +
|
| if (grammarResult.size())
|
| results.swap(grammarResult);
|
|
|
|
|