- pit_type fro, pit_type en, ParagraphList * pl,
- MathData * ar, BufferParams const & bp,
- bool ifb) :
- kind(kin), cursor(cur), cell(cel), from(fro), end(en),
- pars(pl), array(ar), bparams(bp), isFullBuffer(ifb)
- {}
+ pit_type fro, pit_type en, ParagraphList * pl, MathData * ar,
+ bool lc, size_t gid) :
+ kind(kin), cur_before(cb), cell(cel), from(fro), end(en),
+ pars(pl), array(ar), bparams(0),
+ lyx_clean(lc), group_id(gid), time(current_time())
+ {
+ }
+ ///
+ UndoElement(CursorData const & cb, BufferParams const & bp,
+ bool lc, size_t gid) :
+ kind(ATOMIC_UNDO), cur_before(cb), cell(), from(0), end(0),
+ pars(0), array(0), bparams(new BufferParams(bp)),
+ lyx_clean(lc), group_id(gid), time(current_time())
+ {
+ }
+ ///
+ UndoElement(UndoElement const & ue) : time(current_time())
+ {
+ kind = ue.kind;
+ cur_before = ue.cur_before;
+ cur_after = ue.cur_after;
+ cell = ue.cell;
+ from = ue.from;
+ end = ue.end;
+ pars = ue.pars;
+ array = ue.array;
+ bparams = ue.bparams
+ ? new BufferParams(*ue.bparams) : 0;
+ lyx_clean = ue.lyx_clean;
+ group_id = ue.group_id;
+ }
+ ///
+ ~UndoElement()
+ {
+ if (bparams)
+ delete bparams;
+ }