Index: Source/core/editing/ReplaceSelectionCommand.cpp |
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp |
index 23e66bfd150b895a898f5757a602c9e8aee1ce8a..a68b370d1ceb07d8fcced6821371e3f0b2195a6b 100644 |
--- a/Source/core/editing/ReplaceSelectionCommand.cpp |
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp |
@@ -821,7 +821,7 @@ void ReplaceSelectionCommand::mergeEndIfNeeded() |
if (endOfParagraph(startOfParagraphToMove) == destination) { |
RefPtr<Node> placeholder = createBreakElement(document()); |
insertNodeBefore(placeholder, startOfParagraphToMove.deepEquivalent().deprecatedNode()); |
- destination = VisiblePosition(positionBeforeNode(placeholder.get())); |
+ destination = VisiblePosition(positionBeforeNode(*placeholder)); |
} |
moveParagraph(startOfParagraphToMove, endOfParagraph(startOfParagraphToMove), destination); |
@@ -990,7 +990,7 @@ void ReplaceSelectionCommand::doApply() |
Node* endBR = insertionPos.downstream().deprecatedNode()->hasTagName(brTag) ? insertionPos.downstream().deprecatedNode() : 0; |
VisiblePosition originalVisPosBeforeEndBR; |
if (endBR) |
- originalVisPosBeforeEndBR = VisiblePosition(positionBeforeNode(endBR), DOWNSTREAM).previous(); |
+ originalVisPosBeforeEndBR = VisiblePosition(positionBeforeNode(*endBR), DOWNSTREAM).previous(); |
RefPtr<Node> insertionBlock = enclosingBlock(insertionPos.deprecatedNode()); |
@@ -1233,7 +1233,7 @@ bool ReplaceSelectionCommand::shouldRemoveEndBR(Node* endBR, const VisiblePositi |
if (!endBR || !endBR->inDocument()) |
return false; |
- VisiblePosition visiblePos(positionBeforeNode(endBR)); |
+ VisiblePosition visiblePos(positionBeforeNode(*endBR)); |
// Don't remove the br if nothing was inserted. |
if (visiblePos.previous() == originalVisPosBeforeEndBR) |
@@ -1490,7 +1490,7 @@ bool ReplaceSelectionCommand::performTrivialReplace(const ReplacementFragment& f |
return false; |
if (nodeAfterInsertionPos && nodeAfterInsertionPos->parentNode() && nodeAfterInsertionPos->hasTagName(brTag) |
- && shouldRemoveEndBR(nodeAfterInsertionPos.get(), VisiblePosition(positionBeforeNode(nodeAfterInsertionPos.get())))) |
+ && shouldRemoveEndBR(nodeAfterInsertionPos.get(), VisiblePosition(positionBeforeNode(*nodeAfterInsertionPos)))) |
removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); |
VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, end); |