Index: Source/core/editing/InsertLineBreakCommand.cpp |
diff --git a/Source/core/editing/InsertLineBreakCommand.cpp b/Source/core/editing/InsertLineBreakCommand.cpp |
index 22d9ff26e9b0d85b2225b65b911881ee9362f7a1..4862f6f7cff45563a060114e53f3378bfae86ff1 100644 |
--- a/Source/core/editing/InsertLineBreakCommand.cpp |
+++ b/Source/core/editing/InsertLineBreakCommand.cpp |
@@ -43,7 +43,7 @@ namespace WebCore { |
using namespace HTMLNames; |
-InsertLineBreakCommand::InsertLineBreakCommand(Document* document) |
+InsertLineBreakCommand::InsertLineBreakCommand(Document& document) |
: CompositeEditCommand(document) |
{ |
} |
@@ -108,9 +108,9 @@ void InsertLineBreakCommand::doApply() |
RefPtr<Node> nodeToInsert; |
if (shouldUseBreakElement(pos)) |
- nodeToInsert = createBreakElement(document()); |
+ nodeToInsert = createBreakElement(&document()); |
else |
- nodeToInsert = document()->createTextNode("\n"); |
+ nodeToInsert = document().createTextNode("\n"); |
// FIXME: Need to merge text nodes when inserting just after or before text. |
@@ -145,7 +145,7 @@ void InsertLineBreakCommand::doApply() |
Position endingPosition = firstPositionInNode(textNode); |
// Handle whitespace that occurs after the split |
- document()->updateLayoutIgnorePendingStylesheets(); |
+ document().updateLayoutIgnorePendingStylesheets(); |
if (!endingPosition.isRenderedCharacter()) { |
Position positionBeforeTextNode(positionInParentBeforeNode(textNode)); |
// Clear out all whitespace and insert one non-breaking space |
@@ -155,7 +155,7 @@ void InsertLineBreakCommand::doApply() |
if (textNode->inDocument()) |
insertTextIntoNode(textNode, 0, nonBreakingSpaceString()); |
else { |
- RefPtr<Text> nbspNode = document()->createTextNode(nonBreakingSpaceString()); |
+ RefPtr<Text> nbspNode = document().createTextNode(nonBreakingSpaceString()); |
insertNodeAt(nbspNode.get(), positionBeforeTextNode); |
endingPosition = firstPositionInNode(nbspNode.get()); |
} |
@@ -166,7 +166,7 @@ void InsertLineBreakCommand::doApply() |
// Handle the case where there is a typing style. |
- RefPtr<EditingStyle> typingStyle = document()->frame()->selection()->typingStyle(); |
+ RefPtr<EditingStyle> typingStyle = document().frame()->selection()->typingStyle(); |
if (typingStyle && !typingStyle->isEmpty()) { |
// Apply the typing style to the inserted line break, so that if the selection |