diff options
Diffstat (limited to 'WebCore/editing/EditCommand.cpp')
-rw-r--r-- | WebCore/editing/EditCommand.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/WebCore/editing/EditCommand.cpp b/WebCore/editing/EditCommand.cpp index 2301c54..db447a5 100644 --- a/WebCore/editing/EditCommand.cpp +++ b/WebCore/editing/EditCommand.cpp @@ -62,7 +62,7 @@ void EditCommand::apply() Frame* frame = m_document->frame(); - if (!m_parent) { + if (isTopLevelCommand()) { if (!endingSelection().isContentRichlyEditable()) { switch (editingAction()) { case EditActionTyping: @@ -83,7 +83,7 @@ void EditCommand::apply() // require a layout, as in <rdar://problem/5658603>. Low level operations, like // RemoveNodeCommand, don't require a layout because the high level operations that // use them perform one if one is necessary (like for the creation of VisiblePositions). - if (!m_parent) + if (isTopLevelCommand()) updateLayout(); DeleteButtonController* deleteButtonController = frame->editor()->deleteButtonController(); @@ -91,8 +91,7 @@ void EditCommand::apply() doApply(); deleteButtonController->enable(); - if (!m_parent) { - updateLayout(); + if (isTopLevelCommand()) { // Only need to call appliedEditing for top-level commands, and TypingCommands do it on their // own (see TypingCommand::typingAddedToOpenCommand). if (!isTypingCommand()) @@ -111,7 +110,7 @@ void EditCommand::unapply() // require a layout, as in <rdar://problem/5658603>. Low level operations, like // RemoveNodeCommand, don't require a layout because the high level operations that // use them perform one if one is necessary (like for the creation of VisiblePositions). - if (!m_parent) + if (isTopLevelCommand()) updateLayout(); DeleteButtonController* deleteButtonController = frame->editor()->deleteButtonController(); @@ -119,10 +118,8 @@ void EditCommand::unapply() doUnapply(); deleteButtonController->enable(); - if (!m_parent) { - updateLayout(); + if (isTopLevelCommand()) frame->editor()->unappliedEditing(this); - } } void EditCommand::reapply() @@ -136,7 +133,7 @@ void EditCommand::reapply() // require a layout, as in <rdar://problem/5658603>. Low level operations, like // RemoveNodeCommand, don't require a layout because the high level operations that // use them perform one if one is necessary (like for the creation of VisiblePositions). - if (!m_parent) + if (isTopLevelCommand()) updateLayout(); DeleteButtonController* deleteButtonController = frame->editor()->deleteButtonController(); @@ -144,10 +141,8 @@ void EditCommand::reapply() doReapply(); deleteButtonController->enable(); - if (!m_parent) { - updateLayout(); + if (isTopLevelCommand()) frame->editor()->reappliedEditing(this); - } } void EditCommand::doReapply() |