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

Unified Diff: Source/core/editing/InsertParagraphSeparatorCommand.cpp

Issue 23548010: Have htmlediting create functions take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/core/editing/InsertListCommand.cpp ('k') | Source/core/editing/InsertTextCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/InsertParagraphSeparatorCommand.cpp
diff --git a/Source/core/editing/InsertParagraphSeparatorCommand.cpp b/Source/core/editing/InsertParagraphSeparatorCommand.cpp
index 4f8c8d3004e374198ffcce6e454e7128ef792522..524b115363313f6803992c62dc021bea7b23ba13 100644
--- a/Source/core/editing/InsertParagraphSeparatorCommand.cpp
+++ b/Source/core/editing/InsertParagraphSeparatorCommand.cpp
@@ -201,10 +201,10 @@ void InsertParagraphSeparatorCommand::doApply()
// Create block to be inserted.
RefPtr<Element> blockToInsert;
if (startBlock->isRootEditableElement()) {
- blockToInsert = createDefaultParagraphElement(&document());
+ blockToInsert = createDefaultParagraphElement(document());
nestNewBlock = true;
} else if (shouldUseDefaultParagraphElement(startBlock.get())) {
- blockToInsert = createDefaultParagraphElement(&document());
+ blockToInsert = createDefaultParagraphElement(document());
} else {
blockToInsert = startBlock->cloneElementWithoutChildren();
}
@@ -217,7 +217,7 @@ void InsertParagraphSeparatorCommand::doApply()
if (isFirstInBlock && !lineBreakExistsAtVisiblePosition(visiblePos)) {
// The block is empty. Create an empty block to
// represent the paragraph that we're leaving.
- RefPtr<Element> extraBlock = createDefaultParagraphElement(&document());
+ RefPtr<Element> extraBlock = createDefaultParagraphElement(document());
appendNode(extraBlock, startBlock);
appendBlockPlaceholder(extraBlock);
}
@@ -297,7 +297,7 @@ void InsertParagraphSeparatorCommand::doApply()
// it if visiblePos is at the start of a paragraph so that the
// content will move down a line.
if (isStartOfParagraph(visiblePos)) {
- RefPtr<Element> br = createBreakElement(&document());
+ RefPtr<Element> br = createBreakElement(document());
insertNodeAt(br.get(), insertionPosition);
insertionPosition = positionInParentAfterNode(br.get());
// If the insertion point is a break element, there is nothing else
@@ -366,7 +366,7 @@ void InsertParagraphSeparatorCommand::doApply()
// created. All of the nodes, starting at visiblePos, are about to be added to the new paragraph
// element. If the first node to be inserted won't be one that will hold an empty line open, add a br.
if (isEndOfParagraph(visiblePos) && !lineBreakExistsAtVisiblePosition(visiblePos))
- appendNode(createBreakElement(&document()).get(), blockToInsert.get());
+ appendNode(createBreakElement(document()).get(), blockToInsert.get());
// Move the start node and the siblings of the start node.
if (VisiblePosition(insertionPosition) != VisiblePosition(positionBeforeNode(blockToInsert.get()))) {
« no previous file with comments | « Source/core/editing/InsertListCommand.cpp ('k') | Source/core/editing/InsertTextCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698