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

Unified Diff: third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp

Issue 2864243003: [DMC #5.8] Move SpellCheckMarkerListImpl::RemoveMarkersUnderWords() impl to correct place (Closed)
Patch Set: Remove blank line Created 3 years, 7 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 | « third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp b/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp
index 5d792c6f7187c3b1b81df52303ce98f2dda8593d..b3ad6755de0e8ed2a75c4373e550e671658eedb4 100644
--- a/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListImpl.cpp
@@ -77,4 +77,21 @@ DEFINE_TRACE(SpellCheckMarkerListImpl) {
DocumentMarkerList::Trace(visitor);
}
+bool SpellCheckMarkerListImpl::RemoveMarkersUnderWords(
+ const String& node_text,
+ const Vector<String>& words) {
+ bool removed_markers = false;
+ for (size_t j = markers_.size(); j > 0; --j) {
+ const DocumentMarker& marker = *markers_[j - 1];
+ const unsigned start = marker.StartOffset();
+ const unsigned length = marker.EndOffset() - marker.StartOffset();
+ const String& marker_text = node_text.Substring(start, length);
+ if (words.Contains(marker_text)) {
+ markers_.erase(j - 1);
+ removed_markers = true;
+ }
+ }
+ return removed_markers;
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698