Reviewed by levi
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Jun 2006 20:18:11 +0000 (20:18 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Jun 2006 20:18:11 +0000 (20:18 +0000)
        Fixed EditActions for InsertHorizontalRule and RemoveFormat.

        * editing/JSEditor.cpp:
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
        (WebCore::ReplaceSelectionCommand::editingAction):
        * editing/ReplaceSelectionCommand.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/editing/JSEditor.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/ReplaceSelectionCommand.h

index 4b16ac6..be13927 100644 (file)
@@ -1,3 +1,15 @@
+2006-06-28  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by levi
+        
+        Fixed EditActions for InsertHorizontalRule and RemoveFormat.
+        
+        * editing/JSEditor.cpp:
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
+        (WebCore::ReplaceSelectionCommand::editingAction):
+        * editing/ReplaceSelectionCommand.h:
+
 2006-06-28  Levi Weintraub  <lweintraub@apple.com>
 
          Build Fix. Reviewed by NOBODY
index f3f4403..2dd85a8 100644 (file)
@@ -281,7 +281,7 @@ bool execInsertHorizontalRule(Frame* frame, bool userInterface, const String& va
     if (ec)
         return false;
     
-    EditCommandPtr(new ReplaceSelectionCommand(frame->document(), fragment.get(), false)).apply();
+    EditCommandPtr(new ReplaceSelectionCommand(frame->document(), fragment.get(), false, false, false, false, EditActionUnspecified)).apply();
     return true;
 }
 
@@ -414,7 +414,7 @@ bool execRedo(Frame *frame, bool userInterface, const String &value)
 bool execRemoveFormat(Frame* frame, bool userInterface, const String& value)
 {
     RefPtr<DocumentFragment> fragment = createFragmentFromText(frame->document(), frame->selection().toString().deprecatedString());
-    EditCommandPtr(new ReplaceSelectionCommand(frame->document(), fragment.get(), false)).apply();
+    EditCommandPtr(new ReplaceSelectionCommand(frame->document(), fragment.get(), false, false, false, false, EditActionUnspecified)).apply();
     return true;
 }
 
index f9499eb..c689d3b 100644 (file)
@@ -460,13 +460,14 @@ RenderingInfo::RenderingInfo(PassRefPtr<CSSMutableStyleDeclaration> style, bool
 {
 }
 
-ReplaceSelectionCommand::ReplaceSelectionCommand(Document *document, DocumentFragment *fragment, bool selectReplacement, bool smartReplace, bool matchStyle, bool forceMergeStart) 
+ReplaceSelectionCommand::ReplaceSelectionCommand(Document *document, DocumentFragment *fragment, bool selectReplacement, bool smartReplace, bool matchStyle, bool forceMergeStart, EditAction editAction
     : CompositeEditCommand(document),
       m_selectReplacement(selectReplacement), 
       m_smartReplace(smartReplace),
       m_matchStyle(matchStyle),
       m_documentFragment(fragment),
-      m_forceMergeStart(forceMergeStart)
+      m_forceMergeStart(forceMergeStart),
+      m_editAction(editAction)
 {
 }
 
@@ -860,7 +861,7 @@ void ReplaceSelectionCommand::completeHTMLReplacement(const Position &lastPositi
 
 EditAction ReplaceSelectionCommand::editingAction() const
 {
-    return EditActionPaste;
+    return m_editAction;
 }
 
 void ReplaceSelectionCommand::insertNodeAfterAndUpdateNodesInserted(Node *insertChild, Node *refChild)
index ce75f09..4bdb314 100644 (file)
@@ -113,7 +113,7 @@ private:
 class ReplaceSelectionCommand : public CompositeEditCommand
 {
 public:
-    ReplaceSelectionCommand(Document *document, DocumentFragment *fragment, bool selectReplacement=true, bool smartReplace=false, bool matchStyle=false, bool forceMergeStart=false);
+    ReplaceSelectionCommand(Document *document, DocumentFragment *fragment, bool selectReplacement=true, bool smartReplace=false, bool matchStyle=false, bool forceMergeStart=false, EditAction action=EditActionPaste);
     virtual ~ReplaceSelectionCommand();
     
     virtual void doApply();
@@ -142,6 +142,7 @@ private:
     bool m_matchStyle;
     RefPtr<DocumentFragment> m_documentFragment;
     bool m_forceMergeStart;
+    EditAction m_editAction;
 };
 
 } // namespace WebCore