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

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

Issue 23822003: Have EditCommand classes deal with Document references, not pointers (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/IndentOutdentCommand.h ('k') | Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/IndentOutdentCommand.cpp
diff --git a/Source/core/editing/IndentOutdentCommand.cpp b/Source/core/editing/IndentOutdentCommand.cpp
index da3dbb63ab3a394d7ba2e1c5b95b095aa7aa8a97..a9d85887a526808dfc8e67851f30b965f83c6e4d 100644
--- a/Source/core/editing/IndentOutdentCommand.cpp
+++ b/Source/core/editing/IndentOutdentCommand.cpp
@@ -43,7 +43,7 @@ static bool isListOrIndentBlockquote(const Node* node)
return node && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(blockquoteTag));
}
-IndentOutdentCommand::IndentOutdentCommand(Document* document, EIndentType typeOfAction, int marginInPixels)
+IndentOutdentCommand::IndentOutdentCommand(Document& document, EIndentType typeOfAction, int marginInPixels)
: ApplyBlockElementCommand(document, blockquoteTag, "margin: 0 0 0 40px; border: none; padding: 0px;")
, m_typeOfAction(typeOfAction)
, m_marginInPixels(marginInPixels)
@@ -69,7 +69,7 @@ bool IndentOutdentCommand::tryIndentingAsListItem(const Position& start, const P
Element* previousList = selectedListItem->previousElementSibling();
Element* nextList = selectedListItem->nextElementSibling();
- RefPtr<Element> newList = document()->createElement(listNode->tagQName(), false);
+ RefPtr<Element> newList = document().createElement(listNode->tagQName(), false);
insertNodeBefore(newList, selectedListItem);
moveParagraphWithClones(start, end, newList.get(), selectedListItem);
@@ -156,13 +156,13 @@ void IndentOutdentCommand::outdentParagraph()
}
}
- document()->updateLayoutIgnorePendingStylesheets();
+ document().updateLayoutIgnorePendingStylesheets();
visibleStartOfParagraph = VisiblePosition(visibleStartOfParagraph.deepEquivalent());
visibleEndOfParagraph = VisiblePosition(visibleEndOfParagraph.deepEquivalent());
if (visibleStartOfParagraph.isNotNull() && !isStartOfParagraph(visibleStartOfParagraph))
- insertNodeAt(createBreakElement(document()), visibleStartOfParagraph.deepEquivalent());
+ insertNodeAt(createBreakElement(&document()), visibleStartOfParagraph.deepEquivalent());
if (visibleEndOfParagraph.isNotNull() && !isEndOfParagraph(visibleEndOfParagraph))
- insertNodeAt(createBreakElement(document()), visibleEndOfParagraph.deepEquivalent());
+ insertNodeAt(createBreakElement(&document()), visibleEndOfParagraph.deepEquivalent());
return;
}
@@ -175,7 +175,7 @@ void IndentOutdentCommand::outdentParagraph()
Node* highestInlineNode = highestEnclosingNodeOfType(visibleStartOfParagraph.deepEquivalent(), isInline, CannotCrossEditingBoundary, enclosingBlockFlow);
splitElement(toElement(enclosingNode), (highestInlineNode) ? highestInlineNode : visibleStartOfParagraph.deepEquivalent().deprecatedNode());
}
- RefPtr<Node> placeholder = createBreakElement(document());
+ RefPtr<Node> placeholder = createBreakElement(&document());
insertNodeBefore(placeholder, splitBlockquoteNode);
moveParagraph(startOfParagraph(visibleStartOfParagraph), endOfParagraph(visibleEndOfParagraph), positionBeforeNode(placeholder.get()), true);
}
« no previous file with comments | « Source/core/editing/IndentOutdentCommand.h ('k') | Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698