From b06797a3125393b64c9d6d02eb4dfd66c30c8dd2 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Wed, 13 Jun 2007 07:43:34 +0000 Subject: [PATCH] * move TOC update behind cur.fixIfBroken() to fix #3851 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18762 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Undo.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Undo.cpp b/src/Undo.cpp index 3dcd54daa8..20c76462e3 100644 --- a/src/Undo.cpp +++ b/src/Undo.cpp @@ -164,6 +164,7 @@ bool textUndoOrRedo(BufferView & bv, // This does the actual undo/redo. //lyxerr << "undo, performing: " << undo << std::endl; + bool labelsUpdateNeeded = false; DocIterator dit = undo.cell.asDocIterator(&buf->inset()); if (undo.isFullBuffer) { BOOST_ASSERT(undo.pars); @@ -209,7 +210,7 @@ bool textUndoOrRedo(BufferView & bv, plist.insert(first, undo.pars->begin(), undo.pars->end()); delete undo.pars; undo.pars = 0; - updateLabels(*buf); + labelsUpdateNeeded = true; } BOOST_ASSERT(undo.pars == 0); BOOST_ASSERT(undo.array == 0); @@ -220,8 +221,10 @@ bool textUndoOrRedo(BufferView & bv, cur.selection() = false; cur.resetAnchor(); cur.fixIfBroken(); + + if (labelsUpdateNeeded) + updateLabels(*buf); finishUndo(); - return true; }