src/edithistory.cpp

changeset 149
008989bc7d6e
parent 136
e8444e0d7f1a
--- 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()
+{
+}

mercurial