MCPcopy Create free account
hub / github.com/Simsys/qhexedit2 / removeAt

Method removeAt

src/commands.cpp:126–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void UndoStack::removeAt(qint64 pos, qint64 len)
127{
128 if ((pos >= 0) && (pos < _chunks->size()))
129 {
130 if (len==1)
131 {
132 QUndoCommand *cc = new CharCommand(_chunks, CharCommand::removeAt, pos, char(0));
133 this->push(cc);
134 }
135 else
136 {
137 QString txt = QString(tr("Delete %1 chars")).arg(len);
138 beginMacro(txt);
139 for (qint64 cnt=0; cnt<len; cnt++)
140 {
141 QUndoCommand *cc = new CharCommand(_chunks, CharCommand::removeAt, pos, char(0));
142 push(cc);
143 }
144 endMacro();
145 }
146 }
147}
148
149void UndoStack::overwrite(qint64 pos, char c)
150{

Callers 2

undoMethod · 0.45
redoMethod · 0.45

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected