diff -r e1ced2523cad -r 008989bc7d6e src/edithistory.cpp --- a/src/edithistory.cpp Tue Nov 02 15:43:57 2021 +0200 +++ b/src/edithistory.cpp Tue Mar 01 17:00:19 2022 +0200 @@ -46,10 +46,24 @@ void EditHistoryEntry::undo(Model::EditContext &editContext) { - + this->doUndoRedo(editContext, this->stateAfter); } void EditHistoryEntry::redo(Model::EditContext &editContext) { - + this->doUndoRedo(editContext, this->stateBefore); } + +void EditHistoryEntry::doUndoRedo(Model::EditContext &editContext, QByteArray &state) +{ + const ldraw::id_t id = editContext.resolve(this->position); + if (id != ldraw::NULL_ID) + { + QDataStream stream{&state, QIODevice::ReadOnly}; + editContext.deserialize(id, stream); + } +} + +AbstractHistoryEntry::~AbstractHistoryEntry() +{ +}