Commit c38fed25 authored by justing's avatar justing

Reviewed by levi

        
        Fixed EditActions for InsertHorizontalRule and RemoveFormat.
        
        * editing/JSEditor.cpp:
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
        (WebCore::ReplaceSelectionCommand::editingAction):
        * editing/ReplaceSelectionCommand.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c7655e15
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
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment