]> git.lyx.org Git - lyx.git/blobdiff - src/Undo.cpp
* GuiView.cpp:
[lyx.git] / src / Undo.cpp
index 7432a1294a511970d4bb59265bf55f573ed6fa9d..06bd16ccc80ce13c0956397b14c23e33931ed925 100644 (file)
@@ -73,13 +73,31 @@ struct UndoElement
                    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