Index: Source/core/editing/InsertLineBreakCommand.cpp |
diff --git a/Source/core/editing/InsertLineBreakCommand.cpp b/Source/core/editing/InsertLineBreakCommand.cpp |
index 606e7cd5884385984784dbff299cdbcfeb52db2c..5270238d9484c1824f62e95d00a0d919b2ccc811 100644 |
--- a/Source/core/editing/InsertLineBreakCommand.cpp |
+++ b/Source/core/editing/InsertLineBreakCommand.cpp |
@@ -106,12 +106,12 @@ void InsertLineBreakCommand::doApply() |
if (!isStartOfParagraph(VisiblePosition(positionBeforeNode(nodeToInsert.get())))) |
insertNodeBefore(nodeToInsert->cloneNode(false).get(), nodeToInsert.get()); |
- setEndingSelection(VisibleSelection(positionInParentAfterNode(nodeToInsert.get()), DOWNSTREAM, endingSelection().isDirectional())); |
+ setEndingSelection(VisibleSelection(positionInParentAfterNode(*nodeToInsert), DOWNSTREAM, endingSelection().isDirectional())); |
// If we're inserting after all of the rendered text in a text node, or into a non-text node, |
// a simple insertion is sufficient. |
} else if (pos.deprecatedEditingOffset() >= caretMaxOffset(pos.deprecatedNode()) || !pos.deprecatedNode()->isTextNode()) { |
insertNodeAt(nodeToInsert.get(), pos); |
- setEndingSelection(VisibleSelection(positionInParentAfterNode(nodeToInsert.get()), DOWNSTREAM, endingSelection().isDirectional())); |
+ setEndingSelection(VisibleSelection(positionInParentAfterNode(*nodeToInsert), DOWNSTREAM, endingSelection().isDirectional())); |
} else if (pos.deprecatedNode()->isTextNode()) { |
// Split a text node |
Text* textNode = toText(pos.deprecatedNode()); |
@@ -122,7 +122,7 @@ void InsertLineBreakCommand::doApply() |
// Handle whitespace that occurs after the split |
document().updateLayoutIgnorePendingStylesheets(); |
if (!endingPosition.isRenderedCharacter()) { |
- Position positionBeforeTextNode(positionInParentBeforeNode(textNode)); |
+ Position positionBeforeTextNode(positionInParentBeforeNode(*textNode)); |
// Clear out all whitespace and insert one non-breaking space |
deleteInsignificantTextDownstream(endingPosition); |
ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseWhiteSpace()); |