-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.2
-
None
If a QUndoCommand contains identical macros, mergeWith() is not called. For some reason this is intentional, the code do:
bool macro = !d->macro_stack.isEmpty();
QUndoCommand *cur = 0;
if (macro) {
QUndoCommand *macro_cmd = d->macro_stack.last();
if (!macro_cmd->d->child_list.isEmpty())
cur = macro_cmd->d->child_list.last();
} else {
if (d->index > 0)
cur = d->command_list.at(d->index - 1);
while (d->index < d->command_list.size())
delete d->command_list.takeLast();
if (d->clean_index > d->index)
d->clean_index = -1; // we've deleted the clean state
}
bool try_merge = cur != 0
&& cur->id() != -1
&& cur->id() == cmd->id()
&& (macro || d->index != d->clean_index);
if (try_merge && cur->mergeWith(cmd)) {