Reviewed by Ken.
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Dec 2004 19:52:06 +0000 (19:52 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Dec 2004 19:52:06 +0000 (19:52 +0000)
        - 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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/htmlediting.h

index 31e8be28c08e4c5518fbbcaf35fc5debb74c7339..12a12b03b0b579a9c32129a30371f07b352edb05 100644 (file)
@@ -1,3 +1,18 @@
+2004-12-14  John Sullivan  <sullivan@apple.com>
+
+        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  <sullivan@apple.com>
 
         Reviewed by Ken.
 2004-12-14  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Ken.
index c8ca44edfa526de04257187edeb67bd9d5fda5b8..6bb3f699c5245269d4264bd9e780d092b5b2c68d 100644 (file)
@@ -1940,6 +1940,14 @@ void DeleteSelectionCommand::doApply()
     rebalanceWhitespace();
 }
 
     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;
 bool DeleteSelectionCommand::preservesTypingStyle() const
 {
     return true;
@@ -2786,6 +2794,11 @@ void MoveSelectionCommand::doApply()
     applyCommandToComposite(cmd);
 }
 
     applyCommandToComposite(cmd);
 }
 
+HTMLEditAction MoveSelectionCommand::editingAction() const
+{
+    return HTMLEditActionDrag;
+}
+
 //------------------------------------------------------------------------------------------
 // RebalanceWhitespaceCommand
 
 //------------------------------------------------------------------------------------------
 // RebalanceWhitespaceCommand
 
@@ -3950,6 +3963,11 @@ void TypingCommand::removeCommand(const EditCommandPtr &cmd)
         setEndingSelection(m_cmds.last().endingSelection());
 }
 
         setEndingSelection(m_cmds.last().endingSelection());
 }
 
+HTMLEditAction ReplaceSelectionCommand::editingAction() const
+{
+    return HTMLEditActionPaste;
+}
+
 bool TypingCommand::preservesTypingStyle() const
 {
     switch (m_commandType) {
 bool TypingCommand::preservesTypingStyle() const
 {
     switch (m_commandType) {
index 1469d017f688f5ade23e89dbd333eaf77ed7834f..e767961ca1114aad3f055d811e6449730ccca103 100644 (file)
@@ -346,6 +346,7 @@ public:
     DeleteSelectionCommand(DOM::DocumentImpl *document, const khtml::Selection &selection, bool smartDelete=false, bool mergeBlocksAfterDelete=true);
        
     virtual void doApply();
     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;
     
 private:
     virtual bool preservesTypingStyle() const;
@@ -530,6 +531,7 @@ public:
     virtual ~MoveSelectionCommand();
     
     virtual void doApply();
     virtual ~MoveSelectionCommand();
     
     virtual void doApply();
+    virtual HTMLEditAction editingAction() const;
     
 private:
     DOM::DocumentFragmentImpl *m_fragment;
     
 private:
     DOM::DocumentFragmentImpl *m_fragment;
@@ -700,6 +702,7 @@ public:
     virtual ~ReplaceSelectionCommand();
     
     virtual void doApply();
     virtual ~ReplaceSelectionCommand();
     
     virtual void doApply();
+    virtual HTMLEditAction editingAction() const;
 
 private:
     void completeHTMLReplacement(const DOM::Position &, const DOM::Position &);
 
 private:
     void completeHTMLReplacement(const DOM::Position &, const DOM::Position &);