[studio] Make UndoCommand::mergeWith take a reference
This commit is contained in:
@@ -124,11 +124,11 @@ UpdateColorCommand::UpdateColorCommand(
|
||||
//setObsolete(m_oldColor == m_newColor);
|
||||
}
|
||||
|
||||
bool UpdateColorCommand::mergeWith(const UndoCommand *cmd) noexcept {
|
||||
if (cmd->commandId() != static_cast<int>(PaletteEditorCommandId::UpdateColor)) {
|
||||
bool UpdateColorCommand::mergeWith(UndoCommand const&cmd) noexcept {
|
||||
if (cmd.commandId() != static_cast<int>(PaletteEditorCommandId::UpdateColor)) {
|
||||
return false;
|
||||
}
|
||||
auto ucCmd = static_cast<const UpdateColorCommand*>(cmd);
|
||||
auto ucCmd = static_cast<UpdateColorCommand const*>(&cmd);
|
||||
if (m_idx != ucCmd->m_idx) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ class UpdateColorCommand: public studio::UndoCommand {
|
||||
~UpdateColorCommand() noexcept override = default;
|
||||
|
||||
[[nodiscard]]
|
||||
bool mergeWith(const UndoCommand *cmd) noexcept final;
|
||||
bool mergeWith(const UndoCommand &cmd) noexcept final;
|
||||
|
||||
[[nodiscard]]
|
||||
int commandId() const noexcept final;
|
||||
|
||||
Reference in New Issue
Block a user