]> git.lyx.org Git - lyx.git/blobdiff - src/Undo.cpp
* GuiView.cpp:
[lyx.git] / src / Undo.cpp
index 7045765769f7682121e0048cc5b52eb6491a869e..06bd16ccc80ce13c0956397b14c23e33931ed925 100644 (file)
@@ -79,7 +79,25 @@ struct UndoElement
                        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