From 0336ebd4471c29375252ea8be5df6b5fe78fbedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 13 Oct 2003 13:59:45 +0000 Subject: [PATCH] restore undo on parlist level. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7912 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/undo_funcs.C | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/undo_funcs.C b/src/undo_funcs.C index ccfcbd94d4..b9670d052f 100644 --- a/src/undo_funcs.C +++ b/src/undo_funcs.C @@ -64,23 +64,12 @@ void recordUndo(BufferView * bv, Undo::undo_kind kind, for (ParIterator it = buf->par_iterator_begin(); it != null; ++it, ++pcount) if (&it.plist() == &plist) break; - //lyxerr << "This is plist #" << pcount << ' ' << &plist << endl; - // We simply record the entire outer paragraphs - // First, identify the outer paragraphs - for (ParIterator it = buf->par_iterator_begin(); it != null; ++it) { - if (it->id() == first->id()) - first = it.outerPar(); - if (it->id() == last->id()) - last = it.outerPar(); - } - // And calculate a stable reference to them int const first_offset = firstpar; int const last_offset = plist.size() - lastpar; // Undo::ATOMIC are always recorded (no overlapping there). - // Overlapping only with insert and delete inside one paragraph: // Nobody wants all removed character appear one by one when undoing. if (! undo_finished && kind != Undo::ATOMIC) { @@ -124,14 +113,14 @@ void recordUndo(BufferView * bv, Undo::undo_kind kind, bool performUndoOrRedo(BufferView * bv, Undo const & undo) { Buffer * buf = bv->buffer(); - ParagraphList & plist = buf->paragraphs(); ParIterator null = buf->par_iterator_end(); ParIterator plit = buf->par_iterator_begin(); int n = undo.plist; for ( ; n && plit != null; ++plit, --n) ; - //lyxerr << "undo: using plist #" << undo.plist << " " << &plit.plist() << endl; + BOOST_ASSERT(plit != null); + ParagraphList & plist = plit.plist(); // Remove new stuff between first and last {