diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/editing/TextInsertionBaseCommand.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/editing/TextInsertionBaseCommand.cpp')
-rw-r--r-- | Source/WebCore/editing/TextInsertionBaseCommand.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Source/WebCore/editing/TextInsertionBaseCommand.cpp b/Source/WebCore/editing/TextInsertionBaseCommand.cpp index fd7219d60..cf9c2624a 100644 --- a/Source/WebCore/editing/TextInsertionBaseCommand.cpp +++ b/Source/WebCore/editing/TextInsertionBaseCommand.cpp @@ -35,21 +35,21 @@ namespace WebCore { -TextInsertionBaseCommand::TextInsertionBaseCommand(Document& document) - : CompositeEditCommand(document) +TextInsertionBaseCommand::TextInsertionBaseCommand(Document& document, EditAction editingAction) + : CompositeEditCommand(document, editingAction) { } -void TextInsertionBaseCommand::applyTextInsertionCommand(Frame* frame, PassRefPtr<TextInsertionBaseCommand> command, const VisibleSelection& selectionForInsertion, const VisibleSelection& endingSelection) +void TextInsertionBaseCommand::applyTextInsertionCommand(Frame* frame, TextInsertionBaseCommand& command, const VisibleSelection& selectionForInsertion, const VisibleSelection& endingSelection) { bool changeSelection = selectionForInsertion != endingSelection; if (changeSelection) { - command->setStartingSelection(selectionForInsertion); - command->setEndingSelection(selectionForInsertion); + command.setStartingSelection(selectionForInsertion); + command.setEndingSelection(selectionForInsertion); } - applyCommand(command); + applyCommand(&command); if (changeSelection) { - command->setEndingSelection(endingSelection); + command.setEndingSelection(endingSelection); frame->selection().setSelection(endingSelection); } } @@ -63,9 +63,9 @@ String dispatchBeforeTextInsertedEvent(const String& text, const VisibleSelectio if (Node* startNode = selectionForInsertion.start().containerNode()) { if (startNode->rootEditableElement()) { // Send BeforeTextInsertedEvent. The event handler will update text if necessary. - RefPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text); - startNode->rootEditableElement()->dispatchEvent(evt, IGNORE_EXCEPTION); - newText = evt->text(); + Ref<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(text); + startNode->rootEditableElement()->dispatchEvent(event); + newText = event->text(); } } return newText; @@ -77,8 +77,8 @@ bool canAppendNewLineFeedToSelection(const VisibleSelection& selection) if (!node) return false; - RefPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n")); - node->dispatchEvent(event, IGNORE_EXCEPTION); + Ref<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n")); + node->dispatchEvent(event); return event->text().length(); } |