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

Unified Diff: Source/core/editing/SplitTextNodeCommand.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
Index: Source/core/editing/SplitTextNodeCommand.cpp
diff --git a/Source/core/editing/SplitTextNodeCommand.cpp b/Source/core/editing/SplitTextNodeCommand.cpp
index 7c25e9f5248f34bab89c3b01670c4d8feb3e1026..81f38af7d869d0b40fd3e256c47a32d03b8a3d72 100644
--- a/Source/core/editing/SplitTextNodeCommand.cpp
+++ b/Source/core/editing/SplitTextNodeCommand.cpp
@@ -36,7 +36,7 @@
namespace WebCore {
SplitTextNodeCommand::SplitTextNodeCommand(PassRefPtr<Text> text, int offset)
- : SimpleEditCommand(&text->document())
+ : SimpleEditCommand(text->document())
, m_text2(text)
, m_offset(offset)
{
@@ -60,9 +60,9 @@ void SplitTextNodeCommand::doApply()
if (prefixText.isEmpty())
return;
- m_text1 = Text::create(document(), prefixText);
+ m_text1 = Text::create(&document(), prefixText);
ASSERT(m_text1);
- document()->markers()->copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0);
+ document().markers()->copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0);
insertText1AndTrimText2();
}
@@ -72,13 +72,13 @@ void SplitTextNodeCommand::doUnapply()
if (!m_text1 || !m_text1->rendererIsEditable())
return;
- ASSERT(&m_text1->document() == document());
+ ASSERT(&m_text1->document() == &document());
String prefixText = m_text1->data();
m_text2->insertData(0, prefixText, ASSERT_NO_EXCEPTION, DeprecatedAttachNow);
- document()->markers()->copyMarkers(m_text1.get(), 0, prefixText.length(), m_text2.get(), 0);
+ document().markers()->copyMarkers(m_text1.get(), 0, prefixText.length(), m_text2.get(), 0);
m_text1->remove(ASSERT_NO_EXCEPTION);
}
« no previous file with comments | « Source/core/editing/SplitElementCommand.cpp ('k') | Source/core/editing/SplitTextNodeContainingElementCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698