Commit 92f3c6f2 authored by C. Boemann's avatar C. Boemann

Now that the shapedelete commands are child commands we shouldn't handle them seperately

This also fixes
bug:286888
parent fa081e2a
......@@ -52,10 +52,6 @@ DeleteCommand::DeleteCommand(DeleteMode mode,
void DeleteCommand::undo()
{
foreach (KUndo2Command *command, m_shapeDeleteCommands) {
command->undo();
}
KoTextCommandBase::undo();
UndoRedoFinalizer finalizer(this);
updateListChanges();
......@@ -66,9 +62,6 @@ void DeleteCommand::redo()
{
m_undone = false;
if (!m_first) {
foreach (KUndo2Command *command, m_shapeDeleteCommands)
command->redo();
KoTextCommandBase::redo();
UndoRedoFinalizer finalizer(this);
} else {
......@@ -239,7 +232,6 @@ void DeleteCommand::deleteTextAnchor(KoInlineObject *object)
KoShape *shape = anchor->shape();
KUndo2Command *shapeDeleteCommand = m_shapeController->removeShape(shape, this);
shapeDeleteCommand->redo();
m_shapeDeleteCommands.push_back(shapeDeleteCommand);
}
}
}
......@@ -287,9 +279,6 @@ bool DeleteCommand::mergeWith(const KUndo2Command *command)
DeleteCommand *other = const_cast<DeleteCommand *>(static_cast<const DeleteCommand *>(command));
m_shapeDeleteCommands += other->m_shapeDeleteCommands;
other->m_shapeDeleteCommands.clear();
m_invalidInlineObjects += other->m_invalidInlineObjects;
other->m_invalidInlineObjects.clear();
......@@ -355,11 +344,4 @@ void DeleteCommand::updateListChanges()
DeleteCommand::~DeleteCommand()
{
if (!m_undone && m_document) {
KoTextEditor *textEditor = KoTextDocument(m_document).textEditor();
if (textEditor == 0)
return;
foreach (KUndo2Command *command, m_shapeDeleteCommands)
delete command;
}
}
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