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

Unified Diff: Source/core/editing/InputMethodController.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.cpp ('k') | Source/core/editing/InsertIntoTextNodeCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/InputMethodController.cpp
diff --git a/Source/core/editing/InputMethodController.cpp b/Source/core/editing/InputMethodController.cpp
index fc2978bb2b4272e436d198d5b4b12ba273742213..4c3d19380179426bbb4dd41e4f1f59477ccdde47 100644
--- a/Source/core/editing/InputMethodController.cpp
+++ b/Source/core/editing/InputMethodController.cpp
@@ -205,8 +205,10 @@ void InputMethodController::finishComposition(const String& text, FinishComposit
// If text is empty, then delete the old composition here. If text is non-empty, InsertTextCommand::input
// will delete the old composition with an optimized replace operation.
- if (text.isEmpty() && mode != CancelComposition)
- TypingCommand::deleteSelection(m_frame->document(), 0);
+ if (text.isEmpty() && mode != CancelComposition) {
+ ASSERT(m_frame->document());
+ TypingCommand::deleteSelection(*m_frame->document(), 0);
+ }
m_compositionNode = 0;
m_customCompositionUnderlines.clear();
@@ -271,14 +273,17 @@ void InputMethodController::setComposition(const String& text, const Vector<Comp
// If text is empty, then delete the old composition here. If text is non-empty, InsertTextCommand::input
// will delete the old composition with an optimized replace operation.
- if (text.isEmpty())
- TypingCommand::deleteSelection(m_frame->document(), TypingCommand::PreventSpellChecking);
+ if (text.isEmpty()) {
+ ASSERT(m_frame->document());
+ TypingCommand::deleteSelection(*m_frame->document(), TypingCommand::PreventSpellChecking);
+ }
m_compositionNode = 0;
m_customCompositionUnderlines.clear();
if (!text.isEmpty()) {
- TypingCommand::insertText(m_frame->document(), text, TypingCommand::SelectInsertedText | TypingCommand::PreventSpellChecking, TypingCommand::TextCompositionUpdate);
+ ASSERT(m_frame->document());
+ TypingCommand::insertText(*m_frame->document(), text, TypingCommand::SelectInsertedText | TypingCommand::PreventSpellChecking, TypingCommand::TextCompositionUpdate);
// Find out what node has the composition now.
Position base = m_frame->selection()->base().downstream();
« no previous file with comments | « Source/core/editing/IndentOutdentCommand.cpp ('k') | Source/core/editing/InsertIntoTextNodeCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698