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 31e8be2..12a12b0 100644 (file)
@@ -2,6 +2,21 @@
 
         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.
+        
         - architecture for WebCore part of fix for <rdar://problem/3790011> undoable operations all say "Undo" in the menu, 
         no specific action names
           
index c8ca44e..6bb3f69 100644 (file)
@@ -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) {
index 1469d01..e767961 100644 (file)
@@ -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 &);