WingHexExplorer2/3rdparty/QHexView/document/commands/meta/metaaddcommand.cpp

14 lines
471 B
C++

#include "metaaddcommand.h"
MetaAddCommand::MetaAddCommand(QHexMetadata *hexmeta,
const QHexMetadataItem &meta,
QUndoCommand *parent)
: MetaCommand(hexmeta, meta, parent) {}
void MetaAddCommand::redo() {
m_hexmeta->metadata(m_meta.begin, m_meta.end, m_meta.foreground,
m_meta.background, m_meta.comment);
}
void MetaAddCommand::undo() { m_hexmeta->removeMetadata(m_meta); }