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

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

Issue 1305963003: Introduce {next,previous}PositionOf() as replacement of {next,previous}() member functions in Positi (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-22T00:12:04 Rebase Created 5 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
« no previous file with comments | « Source/core/editing/EditingUtilities.cpp ('k') | Source/core/editing/Position.h » ('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 cbfebe7732840b7a0a9d26fbbef22a278e246483..2414b6525e8db3143cbade4554f5c20f031421a3 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -1202,10 +1202,15 @@ static PassRefPtrWillBeRawPtr<Range> findStringBetweenPositions(const String& ta
// return such section as a Range, we skip this match and seek for the
// next occurrence.
// TODO(yosin) Handle this case.
- if (forward)
- searchRange = EphemeralRangeTemplate<Strategy>(resultRange.startPosition().next(), searchRange.endPosition());
- else
- searchRange = EphemeralRangeTemplate<Strategy>(searchRange.startPosition(), resultRange.endPosition().previous());
+ if (forward) {
+ // TODO(yosin) We should use |PositionMoveType::Character|
+ // for |nextPositionOf()|.
+ searchRange = EphemeralRangeTemplate<Strategy>(nextPositionOf(resultRange.startPosition(), PositionMoveType::CodePoint), searchRange.endPosition());
+ } else {
+ // TODO(yosin) We should use |PositionMoveType::Character|
+ // for |previousPositionOf()|.
+ searchRange = EphemeralRangeTemplate<Strategy>(searchRange.startPosition(), previousPositionOf(resultRange.endPosition(), PositionMoveType::CodePoint));
+ }
}
ASSERT_NOT_REACHED();
« no previous file with comments | « Source/core/editing/EditingUtilities.cpp ('k') | Source/core/editing/Position.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698