From: sullivan Date: Tue, 14 Dec 2004 19:52:06 +0000 (+0000) Subject: Reviewed by Ken. X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=acfa8acfbdf9ad1a6fbb997d82df125b9151659a Reviewed by Ken. - added Undo action names for Cut, Paste, and Drag * khtml/editing/htmlediting.h: * khtml/editing/htmlediting.cpp: (khtml::DeleteSelectionCommand::editingAction): overridden to return HTMLEditActionCut (khtml::MoveSelectionCommand::editingAction): overridden to return HTMLEditActionDrag (khtml::ReplaceSelectionCommand::editingAction): overridden to return HTMLEditActionPaste git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8207 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23 index 31e8be28c08e..12a12b03b0b5 100644 --- a/WebCore/ChangeLog-2005-08-23 +++ b/WebCore/ChangeLog-2005-08-23 @@ -1,3 +1,18 @@ +2004-12-14 John Sullivan + + Reviewed by Ken. + + - added Undo action names for Cut, Paste, and Drag + + * khtml/editing/htmlediting.h: + * khtml/editing/htmlediting.cpp: + (khtml::DeleteSelectionCommand::editingAction): + overridden to return HTMLEditActionCut + (khtml::MoveSelectionCommand::editingAction): + overridden to return HTMLEditActionDrag + (khtml::ReplaceSelectionCommand::editingAction): + overridden to return HTMLEditActionPaste + 2004-12-14 John Sullivan Reviewed by Ken. diff --git a/WebCore/khtml/editing/htmlediting.cpp b/WebCore/khtml/editing/htmlediting.cpp index c8ca44edfa52..6bb3f699c524 100644 --- a/WebCore/khtml/editing/htmlediting.cpp +++ b/WebCore/khtml/editing/htmlediting.cpp @@ -1940,6 +1940,14 @@ void DeleteSelectionCommand::doApply() rebalanceWhitespace(); } +HTMLEditAction DeleteSelectionCommand::editingAction() const +{ + // Note that DeleteSelectionCommand is also used when the user presses the Delete key, + // but in that case there's a TypingCommand that supplies the editingAction(), so + // the Undo menu correctly shows "Undo Typing" + return HTMLEditActionCut; +} + bool DeleteSelectionCommand::preservesTypingStyle() const { return true; @@ -2786,6 +2794,11 @@ void MoveSelectionCommand::doApply() applyCommandToComposite(cmd); } +HTMLEditAction MoveSelectionCommand::editingAction() const +{ + return HTMLEditActionDrag; +} + //------------------------------------------------------------------------------------------ // RebalanceWhitespaceCommand @@ -3950,6 +3963,11 @@ void TypingCommand::removeCommand(const EditCommandPtr &cmd) setEndingSelection(m_cmds.last().endingSelection()); } +HTMLEditAction ReplaceSelectionCommand::editingAction() const +{ + return HTMLEditActionPaste; +} + bool TypingCommand::preservesTypingStyle() const { switch (m_commandType) { diff --git a/WebCore/khtml/editing/htmlediting.h b/WebCore/khtml/editing/htmlediting.h index 1469d017f688..e767961ca111 100644 --- a/WebCore/khtml/editing/htmlediting.h +++ b/WebCore/khtml/editing/htmlediting.h @@ -346,6 +346,7 @@ public: DeleteSelectionCommand(DOM::DocumentImpl *document, const khtml::Selection &selection, bool smartDelete=false, bool mergeBlocksAfterDelete=true); virtual void doApply(); + virtual HTMLEditAction editingAction() const; private: virtual bool preservesTypingStyle() const; @@ -530,6 +531,7 @@ public: virtual ~MoveSelectionCommand(); virtual void doApply(); + virtual HTMLEditAction editingAction() const; private: DOM::DocumentFragmentImpl *m_fragment; @@ -700,6 +702,7 @@ public: virtual ~ReplaceSelectionCommand(); virtual void doApply(); + virtual HTMLEditAction editingAction() const; private: void completeHTMLReplacement(const DOM::Position &, const DOM::Position &);