From 3fe01932e313d59c0aa7339b01d92c0c74ccd985 Mon Sep 17 00:00:00 2001 From: "G.K.MacGregor" Date: Sun, 3 Jan 2021 19:19:17 +0000 Subject: [PATCH] Fix subpage check when merging edit triplet commands --- x26commands.cpp | 7 ++++--- x26commands.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/x26commands.cpp b/x26commands.cpp index 7b2603e..663670b 100644 --- a/x26commands.cpp +++ b/x26commands.cpp @@ -187,10 +187,11 @@ void EditTripletCommand::undo() bool EditTripletCommand::mergeWith(const QUndoCommand *command) { - const EditTripletCommand *previousCommand = static_cast(command); + const EditTripletCommand *newerCommand = static_cast(command); - if (m_row != previousCommand->m_row) + if (m_subPageIndex != newerCommand->m_subPageIndex || m_row != newerCommand->m_row) return false; - m_newTriplet = previousCommand->m_newTriplet; + + m_newTriplet = newerCommand->m_newTriplet; return true; } diff --git a/x26commands.h b/x26commands.h index bc49c48..2168e10 100644 --- a/x26commands.h +++ b/x26commands.h @@ -60,7 +60,7 @@ private: class EditTripletCommand : public QUndoCommand { public: - enum { Id = 1 }; + enum { Id = 201 }; enum EditTripletEnum { ETaddress, ETmode, ETdata }; EditTripletCommand(TeletextDocument *, X26Model *, int, int, int, int, int, QUndoCommand *parent = 0);