]> git.lyx.org Git - lyx.git/blobdiff - src/undo_funcs.C
Fixes to References dialog (read-only status) and to Bibtex bibliography
[lyx.git] / src / undo_funcs.C
index d1b0f2ab48425083386cc9f37cbdc96c243e8e24..64afb1ac196babfbd61a8eb4cb21d78bfc2e7d55 100644 (file)
@@ -19,6 +19,7 @@
 #include "buffer.h"
 #include "insets/inset.h"
 #include "debug.h"
+#include "support/LAssert.h"
 
 /// the flag used by FinishUndo();
 bool undo_finished;
@@ -32,13 +33,13 @@ bool textUndo(BufferView * bv)
        if (undo) {
                finishUndo();
                if (!undo_frozen) {
-                       Paragraph * first = bv->text->getParFromID(undo->number_of_before_par);
+                       Paragraph * first = bv->buffer()->getParFromID(undo->number_of_before_par);
                        if (!first)
                                first = firstUndoParagraph(bv, undo->number_of_inset_id);
                        if (first) {
                                bv->buffer()->redostack.push(
                                        createUndo(bv, undo->kind, first,
-                                                          bv->text->getParFromID(undo->number_of_behind_par)));
+                                                          bv->buffer()->getParFromID(undo->number_of_behind_par)));
                        }
                }
        }
@@ -53,13 +54,13 @@ bool textRedo(BufferView * bv)
        if (undo) {
                finishUndo();
                if (!undo_frozen) {
-                       Paragraph * first = bv->text->getParFromID(undo->number_of_before_par);
+                       Paragraph * first = bv->buffer()->getParFromID(undo->number_of_before_par);
                        if (!first)
                                first = firstUndoParagraph(bv, undo->number_of_inset_id);
                        if (first) {
                                bv->buffer()->undostack.push(
                                        createUndo(bv, undo->kind, first,
-                                                  bv->text->getParFromID(undo->number_of_behind_par)));
+                                                  bv->buffer()->getParFromID(undo->number_of_behind_par)));
                        }
                }
        }
@@ -73,9 +74,9 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
        bool result = false;
        if (undo) {
                Paragraph * before =
-                       bv->text->getParFromID(undo->number_of_before_par); 
+                       bv->buffer()->getParFromID(undo->number_of_before_par); 
                Paragraph * behind =
-                       bv->text->getParFromID(undo->number_of_behind_par); 
+                       bv->buffer()->getParFromID(undo->number_of_behind_par); 
                Paragraph * tmppar;
                Paragraph * tmppar2;
                Paragraph * endpar;
@@ -158,8 +159,8 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
                } else
                        endpar = behind;
     
-               tmppar = bv->text->getParFromID(undo->number_of_cursor_par);
-               UpdatableInset* it = static_cast<UpdatableInset*>(tmppar3->InInset());
+               tmppar = bv->buffer()->getParFromID(undo->number_of_cursor_par);
+               UpdatableInset* it = static_cast<UpdatableInset*>(tmppar3->inInset());
                if (it) {
                        it->getLyXText(bv)->redoParagraphs(bv, it->getLyXText(bv)->cursor,
                                                           endpar);
@@ -239,8 +240,8 @@ Undo * createUndo(BufferView * bv, Undo::undo_kind kind,
                before_number = first->previous()->id();
        if (behind)
                behind_number = behind->id();
-       if (first->InInset())
-               inset_id = first->InInset()->id();
+       if (first->inInset())
+               inset_id = first->inInset()->id();
 
        // Undo::EDIT  and Undo::FINISH are
        // always finished. (no overlapping there)