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

Unified Diff: Source/core/page/DragController.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/WrapContentsInDummySpanCommand.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/DragController.cpp
diff --git a/Source/core/page/DragController.cpp b/Source/core/page/DragController.cpp
index 6e2df1bae62ce55fe86bf077e0c78663e59b6a1a..6b0b9b7b6413d798d52c2173f4aa588d86a46ec6 100644
--- a/Source/core/page/DragController.cpp
+++ b/Source/core/page/DragController.cpp
@@ -507,7 +507,8 @@ bool DragController::concludeEditDrag(DragData* dragData)
options |= ReplaceSelectionCommand::SmartReplace;
if (chosePlainText)
options |= ReplaceSelectionCommand::MatchStyle;
- applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse.get(), fragment, options));
+ ASSERT(m_documentUnderMouse);
+ applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse.get(), fragment, options));
}
}
} else {
@@ -516,8 +517,10 @@ bool DragController::concludeEditDrag(DragData* dragData)
return false;
}
- if (setSelectionToDragCaret(innerFrame.get(), dragCaret, range, point))
- applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse.get(), createFragmentFromText(range.get(), text), ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting));
+ if (setSelectionToDragCaret(innerFrame.get(), dragCaret, range, point)) {
+ ASSERT(m_documentUnderMouse);
+ applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse.get(), createFragmentFromText(range.get(), text), ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting));
+ }
}
if (rootEditableElement) {
« no previous file with comments | « Source/core/editing/WrapContentsInDummySpanCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698