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

Unified Diff: Source/core/editing/commands/IndentOutdentCommand.cpp

Issue 1307803003: Introduce nextPositionOf() for VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T18:13:02 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
Index: Source/core/editing/commands/IndentOutdentCommand.cpp
diff --git a/Source/core/editing/commands/IndentOutdentCommand.cpp b/Source/core/editing/commands/IndentOutdentCommand.cpp
index 2a48370d5e0d5b8c306bf628ef08178d5a36321c..bce4f5ee1e12786e7d3e8994f197600686b91773 100644
--- a/Source/core/editing/commands/IndentOutdentCommand.cpp
+++ b/Source/core/editing/commands/IndentOutdentCommand.cpp
@@ -220,10 +220,10 @@ void IndentOutdentCommand::outdentRegion(const VisiblePosition& startOfSelection
}
Position originalSelectionEnd = endingSelection().end();
- VisiblePosition endAfterSelection = endOfParagraph(endOfLastParagraph.next());
+ VisiblePosition endAfterSelection = endOfParagraph(nextPositionOf(endOfLastParagraph));
while (endOfCurrentParagraph.deepEquivalent() != endAfterSelection.deepEquivalent()) {
- VisiblePosition endOfNextParagraph = endOfParagraph(endOfCurrentParagraph.next());
+ VisiblePosition endOfNextParagraph = endOfParagraph(nextPositionOf(endOfCurrentParagraph));
if (endOfCurrentParagraph.deepEquivalent() == endOfLastParagraph.deepEquivalent())
setEndingSelection(VisibleSelection(originalSelectionEnd, TextAffinity::Downstream));
else
@@ -239,7 +239,7 @@ void IndentOutdentCommand::outdentRegion(const VisiblePosition& startOfSelection
if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent().inDocument()) {
endOfCurrentParagraph = VisiblePosition(endingSelection().end());
- endOfNextParagraph = endOfParagraph(endOfCurrentParagraph.next());
+ endOfNextParagraph = endOfParagraph(nextPositionOf(endOfCurrentParagraph));
}
endOfCurrentParagraph = endOfNextParagraph;
}
« no previous file with comments | « Source/core/editing/commands/DeleteSelectionCommand.cpp ('k') | Source/core/editing/commands/InsertListCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698