X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fundo_funcs.C;h=64afb1ac196babfbd61a8eb4cb21d78bfc2e7d55;hb=4e4ebe5d4d675348bbd7f75b9ca6424b6727a253;hp=d1b0f2ab48425083386cc9f37cbdc96c243e8e24;hpb=7521b5d20f42102cf444e3fd8718a088a60d0098;p=lyx.git diff --git a/src/undo_funcs.C b/src/undo_funcs.C index d1b0f2ab48..64afb1ac19 100644 --- a/src/undo_funcs.C +++ b/src/undo_funcs.C @@ -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(tmppar3->InInset()); + tmppar = bv->buffer()->getParFromID(undo->number_of_cursor_par); + UpdatableInset* it = static_cast(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)