| 124 | } |
| 125 | |
| 126 | void 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 | |
| 149 | void UndoStack::overwrite(qint64 pos, char c) |
| 150 | { |