On Wed, Jul 09, 2008 at 06:43:53PM -0400, rgheck wrote: > > Does this seem worth doing? It does save the construction of a BufferParams > for every undo, and Abdel seems to think it's safe.... > > rh > >
> Index: Undo.cpp > =================================================================== > --- Undo.cpp (revision 25523) > +++ Undo.cpp (working copy) > @@ -70,11 +70,25 @@ > UndoElement(UndoKind kin, StableDocIterator const & cur, > StableDocIterator const & cel, > pit_type fro, pit_type en, ParagraphList * pl, > - MathData * ar, BufferParams const & bp, > + MathData * ar, BufferParams & bp, > bool ifb) : > kind(kin), cursor(cur), cell(cel), from(fro), end(en), > pars(pl), array(ar), bparams(bp), isFullBuffer(ifb) > {} > + /// > + UndoElement & operator=(UndoElement const & rhs) > + { > + kind = rhs.kind; > + cursor = rhs.cursor; > + cell = rhs.cell; > + from = rhs.from; > + end = rhs.end; > + pars = rhs.pars; > + array = rhs.array; > + bparams = rhs.bparams; > + isFullBuffer = rhs.isFullBuffer; > + return *this; > + } > /// Which kind of operation are we recording for? > UndoKind kind; > /// the position of the cursor > @@ -90,7 +104,7 @@ > /// the contents of the saved MathData (for mathed) > MathData * array; > /// Only used in case of full backups > - BufferParams bparams; > + BufferParams & bparams; I know it was my doing at some point of time, but can't bparams be a plain pointer similar to the MathData and the ParagraphList we have already in there? Can a UndoElement outlive it's buffer? Andre'