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

Unified Diff: Source/core/editing/CreateLinkCommand.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/CreateLinkCommand.h ('k') | Source/core/editing/DeleteFromTextNodeCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/CreateLinkCommand.cpp
diff --git a/Source/core/editing/CreateLinkCommand.cpp b/Source/core/editing/CreateLinkCommand.cpp
index d21924bbc1c2c804f738092837faa0b227236a9a..4ac85b7300d949d5ec43610b22e13b287a65cff8 100644
--- a/Source/core/editing/CreateLinkCommand.cpp
+++ b/Source/core/editing/CreateLinkCommand.cpp
@@ -31,7 +31,7 @@
namespace WebCore {
-CreateLinkCommand::CreateLinkCommand(Document* document, const String& url)
+CreateLinkCommand::CreateLinkCommand(Document& document, const String& url)
: CompositeEditCommand(document)
{
m_url = url;
@@ -42,14 +42,14 @@ void CreateLinkCommand::doApply()
if (endingSelection().isNone())
return;
- RefPtr<HTMLAnchorElement> anchorElement = HTMLAnchorElement::create(document());
+ RefPtr<HTMLAnchorElement> anchorElement = HTMLAnchorElement::create(&document());
anchorElement->setHref(m_url);
if (endingSelection().isRange())
applyStyledElement(anchorElement.get());
else {
insertNodeAt(anchorElement.get(), endingSelection().start());
- RefPtr<Text> textNode = Text::create(document(), m_url);
+ RefPtr<Text> textNode = Text::create(&document(), m_url);
appendNode(textNode.get(), anchorElement.get());
setEndingSelection(VisibleSelection(positionInParentBeforeNode(anchorElement.get()), positionInParentAfterNode(anchorElement.get()), DOWNSTREAM, endingSelection().isDirectional()));
}
« no previous file with comments | « Source/core/editing/CreateLinkCommand.h ('k') | Source/core/editing/DeleteFromTextNodeCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698