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

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

Issue 2228293002: Remove dead code in spell checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DeprecateTextCheckingType
Patch Set: 201608101257 Created 4 years, 4 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/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);

Powered by Google App Engine
This is Rietveld 408576698