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

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

Issue 2902393003: [DMC #17.5] Eliminate DocumentMarker and TextMatchMarker copy constructors (Closed)
Patch Set: Rebase Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/markers/DocumentMarkerListEditor.h" 5 #include "core/editing/markers/DocumentMarkerListEditor.h"
6 6
7 #include "core/editing/markers/SpellCheckMarkerListImpl.h" 7 #include "core/editing/markers/SpellCheckMarkerListImpl.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 unsigned start_offset, 59 unsigned start_offset,
60 int length) { 60 int length) {
61 bool doc_dirty = false; 61 bool doc_dirty = false;
62 const unsigned end_offset = start_offset + length; 62 const unsigned end_offset = start_offset + length;
63 MarkerList::iterator start_pos = std::upper_bound( 63 MarkerList::iterator start_pos = std::upper_bound(
64 list->begin(), list->end(), start_offset, 64 list->begin(), list->end(), start_offset,
65 [](size_t start_offset, const Member<DocumentMarker>& marker) { 65 [](size_t start_offset, const Member<DocumentMarker>& marker) {
66 return start_offset < marker->EndOffset(); 66 return start_offset < marker->EndOffset();
67 }); 67 });
68 for (MarkerList::iterator i = start_pos; i != list->end();) { 68 for (MarkerList::iterator i = start_pos; i != list->end();) {
69 DocumentMarker marker(*i->Get()); 69 const DocumentMarker& marker = *i->Get();
70 70
71 // markers are returned in order, so stop if we are now past the specified 71 // markers are returned in order, so stop if we are now past the specified
72 // range 72 // range
73 if (marker.StartOffset() >= end_offset) 73 if (marker.StartOffset() >= end_offset)
74 break; 74 break;
75 75
76 list->erase(i - list->begin()); 76 list->erase(i - list->begin());
77 doc_dirty = true; 77 doc_dirty = true;
78 } 78 }
79 79
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 did_shift_marker = true; 135 did_shift_marker = true;
136 marker.SetStartOffset(result.value().start_offset); 136 marker.SetStartOffset(result.value().start_offset);
137 marker.SetEndOffset(result.value().end_offset); 137 marker.SetEndOffset(result.value().end_offset);
138 } 138 }
139 } 139 }
140 140
141 return did_shift_marker; 141 return did_shift_marker;
142 } 142 }
143 143
144 } // namespace blink 144 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698