]> git.lyx.org Git - lyx.git/blobdiff - src/undo.h
fix crash when collapsing ert with cursor inside
[lyx.git] / src / undo.h
index 366d9fc5155699fa528372587374a3b2c0a3b046..7b4aca1c92a27b8bbb0035e49a386d873c7feb2c 100644 (file)
@@ -44,12 +44,13 @@ The idea is to store the contents of 'interesting' paragraphs in some
 structure ('Undo') _before_ it is changed in some edit operation.
 Obviously, the stored ranged should be as small as possible. However, it
 there is a lower limit: The StableDocIterator pointing stored in the undo
-struct must be valid after the changes, too, as it will used as a pointer
-where to insert the stored bits when performining undo. 
+class must be valid after the changes, too, as it will used as a pointer
+where to insert the stored bits when performining undo.
 
 */
 
-struct Undo {
+class Undo {
+public:
        /// This is used to combine consecutive undo recordings of the same kind.
        enum undo_kind {
                /**
@@ -70,12 +71,12 @@ struct Undo {
        undo_kind kind;
        /// the position of the cursor
        StableDocIterator cursor;
-       /// the position of the cell described 
+       /// the position of the cell described
        StableDocIterator cell;
        /// counted from begin of cell
-       lyx::par_type from;
+       lyx::pit_type from;
        /// complement to end of this cell
-       lyx::par_type end;
+       lyx::pit_type end;
        /// the contents of the saved Paragraphs (for texted)
        ParagraphList pars;
        /// the stringified contents of the saved MathArray (for mathed)
@@ -102,10 +103,10 @@ void finishUndo();
 
 /// The general case: prepare undo for an arbitrary range.
 void recordUndo(LCursor & cur, Undo::undo_kind kind,
-       lyx::par_type from, lyx::par_type to);
+       lyx::pit_type from, lyx::pit_type to);
 
 /// Convenience: prepare undo for the range between 'from' and cursor.
-void recordUndo(LCursor & cur, Undo::undo_kind kind, lyx::par_type from);
+void recordUndo(LCursor & cur, Undo::undo_kind kind, lyx::pit_type from);
 
 /// Convenience: prepare undo for the single paragraph or cell
 /// containing the cursor