MathData * ar, BufferParams const & bp,
bool ifb) :
kind(kin), cursor(cur), cell(cel), from(fro), end(en),
- pars(pl), array(ar), isFullBuffer(ifb)
+ pars(pl), array(ar), bparams(0), isFullBuffer(ifb)
{
if (isFullBuffer)
bparams = new BufferParams(bp);
}
///
- ~UndoElement() { delete bparams; }
+ UndoElement(UndoElement const & ue)
+ {
+ kind = ue.kind;
+ cursor = ue.cursor;
+ cell = ue.cell;
+ from = ue.from;
+ end = ue.end;
+ pars = ue.pars;
+ array = ue.array;
+ bparams = ue.isFullBuffer
+ ? new BufferParams(*ue.bparams) : ue.bparams;
+ isFullBuffer = ue.isFullBuffer;
+ }
+ ///
+ ~UndoElement()
+ {
+ if (isFullBuffer)
+ delete bparams;
+ }
/// Which kind of operation are we recording for?
UndoKind kind;
/// the position of the cursor