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

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

Issue 2871823002: [DMC #5.7] Move DocumentMarkerList::RemoveMarkersUnderWords() to SpellCheckMarkerListImpl (Closed)
Patch Set: Rebase 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
Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp
index 60ac613c06ac89ac44a3b89305686db22ab3ea71..1190b2985c6652056737f68d01d20f7c8de90393 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp
@@ -5,6 +5,7 @@
#include "core/editing/markers/DocumentMarkerListEditor.h"
#include "core/editing/markers/RenderedDocumentMarker.h"
+#include "core/editing/markers/SpellCheckMarkerListImpl.h"
namespace blink {
@@ -82,18 +83,18 @@ bool DocumentMarkerListEditor::RemoveMarkers(MarkerList* list,
return doc_dirty;
}
-bool DocumentMarkerListEditor::RemoveMarkersUnderWords(
- MarkerList* list,
+// TODO(rlanday): move to SpellCheckMarkerListImpl.cpp
+bool SpellCheckMarkerListImpl::RemoveMarkersUnderWords(
const String& node_text,
const Vector<String>& words) {
bool removed_markers = false;
- for (size_t j = list->size(); j > 0; --j) {
- const DocumentMarker& marker = *(*list)[j - 1];
+ 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)) {
- list->erase(j - 1);
+ markers_.erase(j - 1);
removed_markers = true;
}
}

Powered by Google App Engine
This is Rietveld 408576698