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

Unified Diff: Source/core/editing/ApplyBlockElementCommand.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/ApplyBlockElementCommand.h ('k') | Source/core/editing/ApplyStyleCommand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ApplyBlockElementCommand.cpp
diff --git a/Source/core/editing/ApplyBlockElementCommand.cpp b/Source/core/editing/ApplyBlockElementCommand.cpp
index 3fb54fc1948f14be1871fef86d0424faf70a2930..bb2e553869c6f794063fae76649b27eaaeb4ffce 100644
--- a/Source/core/editing/ApplyBlockElementCommand.cpp
+++ b/Source/core/editing/ApplyBlockElementCommand.cpp
@@ -41,14 +41,14 @@ namespace WebCore {
using namespace HTMLNames;
-ApplyBlockElementCommand::ApplyBlockElementCommand(Document* document, const QualifiedName& tagName, const AtomicString& inlineStyle)
+ApplyBlockElementCommand::ApplyBlockElementCommand(Document& document, const QualifiedName& tagName, const AtomicString& inlineStyle)
: CompositeEditCommand(document)
, m_tagName(tagName)
, m_inlineStyle(inlineStyle)
{
}
-ApplyBlockElementCommand::ApplyBlockElementCommand(Document* document, const QualifiedName& tagName)
+ApplyBlockElementCommand::ApplyBlockElementCommand(Document& document, const QualifiedName& tagName)
: CompositeEditCommand(document)
, m_tagName(tagName)
{
@@ -87,7 +87,7 @@ void ApplyBlockElementCommand::doApply()
formatSelection(startOfSelection, endOfSelection);
- document()->updateLayoutIgnorePendingStylesheets();
+ document().updateLayoutIgnorePendingStylesheets();
ASSERT(startScope == endScope);
ASSERT(startIndex >= 0);
@@ -108,7 +108,7 @@ void ApplyBlockElementCommand::formatSelection(const VisiblePosition& startOfSel
if (isAtUnsplittableElement(start)) {
RefPtr<Element> blockquote = createBlockElement();
insertNodeAt(blockquote, start);
- RefPtr<Element> placeholder = createBreakElement(document());
+ RefPtr<Element> placeholder = createBreakElement(&document());
appendNode(placeholder, blockquote);
setEndingSelection(VisibleSelection(positionBeforeNode(placeholder.get()), DOWNSTREAM, endingSelection().isDirectional()));
return;
@@ -278,7 +278,7 @@ VisiblePosition ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfN
PassRefPtr<Element> ApplyBlockElementCommand::createBlockElement() const
{
- RefPtr<Element> element = createHTMLElement(document(), m_tagName);
+ RefPtr<Element> element = createHTMLElement(&document(), m_tagName);
if (m_inlineStyle.length())
element->setAttribute(styleAttr, m_inlineStyle);
return element.release();
« no previous file with comments | « Source/core/editing/ApplyBlockElementCommand.h ('k') | Source/core/editing/ApplyStyleCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698