Fix subpage check when merging edit triplet commands

This commit is contained in:
G.K.MacGregor
2021-01-03 19:19:17 +00:00
parent d38bfcf902
commit 3fe01932e3
2 changed files with 5 additions and 4 deletions

View File

@@ -187,10 +187,11 @@ void EditTripletCommand::undo()
bool EditTripletCommand::mergeWith(const QUndoCommand *command) bool EditTripletCommand::mergeWith(const QUndoCommand *command)
{ {
const EditTripletCommand *previousCommand = static_cast<const EditTripletCommand *>(command); const EditTripletCommand *newerCommand = static_cast<const EditTripletCommand *>(command);
if (m_row != previousCommand->m_row) if (m_subPageIndex != newerCommand->m_subPageIndex || m_row != newerCommand->m_row)
return false; return false;
m_newTriplet = previousCommand->m_newTriplet;
m_newTriplet = newerCommand->m_newTriplet;
return true; return true;
} }

View File

@@ -60,7 +60,7 @@ private:
class EditTripletCommand : public QUndoCommand class EditTripletCommand : public QUndoCommand
{ {
public: public:
enum { Id = 1 }; enum { Id = 201 };
enum EditTripletEnum { ETaddress, ETmode, ETdata }; enum EditTripletEnum { ETaddress, ETmode, ETdata };
EditTripletCommand(TeletextDocument *, X26Model *, int, int, int, int, int, QUndoCommand *parent = 0); EditTripletCommand(TeletextDocument *, X26Model *, int, int, int, int, int, QUndoCommand *parent = 0);