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

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

Issue 1317053004: Make VisiblePosition constructor private (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-09-01T18:48:19 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/InsertLineBreakCommand.cpp
diff --git a/Source/core/editing/commands/InsertLineBreakCommand.cpp b/Source/core/editing/commands/InsertLineBreakCommand.cpp
index 1b0e53bb57e1729d33aa670ce9107404f45e6c30..350f0e7c961e2d988b528f3d6632ea70b7998a63 100644
--- a/Source/core/editing/commands/InsertLineBreakCommand.cpp
+++ b/Source/core/editing/commands/InsertLineBreakCommand.cpp
@@ -99,13 +99,13 @@ void InsertLineBreakCommand::doApply()
if (needExtraLineBreak)
insertNodeBefore(nodeToInsert->cloneNode(false), nodeToInsert);
- VisiblePosition endingPosition(positionBeforeNode(nodeToInsert.get()));
+ VisiblePosition endingPosition = createVisiblePosition(positionBeforeNode(nodeToInsert.get()));
setEndingSelection(VisibleSelection(endingPosition, endingSelection().isDirectional()));
} else if (pos.computeEditingOffset() <= caretMinOffset(pos.anchorNode())) {
insertNodeAt(nodeToInsert.get(), pos);
// Insert an extra br or '\n' if the just inserted one collapsed.
- if (!isStartOfParagraph(VisiblePosition(positionBeforeNode(nodeToInsert.get()))))
+ if (!isStartOfParagraph(createVisiblePosition(positionBeforeNode(nodeToInsert.get()))))
insertNodeBefore(nodeToInsert->cloneNode(false).get(), nodeToInsert.get());
setEndingSelection(VisibleSelection(positionInParentAfterNode(*nodeToInsert), TextAffinity::Downstream, endingSelection().isDirectional()));

Powered by Google App Engine
This is Rietveld 408576698