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

Unified Diff: Source/core/editing/Editor.cpp

Issue 24198006: [blink] Add a DocumentMarker::MisspellingMarkers helper (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/core/dom/DocumentMarker.h ('k') | Source/core/editing/SpellCheckRequester.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index 16a9e01182b7f9b580ee9dc6b4fc5fc3e114215c..114338e247f15db2bd358f8afd61952819aebf70 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -1387,10 +1387,8 @@ void Editor::showSpellingGuessPanel()
void Editor::clearMisspellingsAndBadGrammar(const VisibleSelection &movingSelection)
{
RefPtr<Range> selectedRange = movingSelection.toNormalizedRange();
- if (selectedRange) {
- frame().document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
- frame().document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Grammar);
- }
+ if (selectedRange)
+ frame().document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::MisspellingMarkers());
}
void Editor::markMisspellingsAndBadGrammar(const VisibleSelection &movingSelection)
@@ -1752,7 +1750,7 @@ void Editor::updateMarkersForWordsAffectedByEditing(bool doNotRemoveIfSelectionA
ASSERT(document);
RefPtr<Range> wordRange = Range::create(*document, startOfFirstWord.deepEquivalent(), endOfLastWord.deepEquivalent());
- document->markers()->removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::Grammar, DocumentMarkerController::RemovePartiallyOverlappingMarker);
+ document->markers()->removeMarkers(wordRange.get(), DocumentMarker::MisspellingMarkers(), DocumentMarkerController::RemovePartiallyOverlappingMarker);
}
PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint)
« no previous file with comments | « Source/core/dom/DocumentMarker.h ('k') | Source/core/editing/SpellCheckRequester.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698