X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FUndo.cpp;h=20c76462e3b3324b5ab5e914df53e09ff1c89fcf;hb=8524ee93c35ed3ca15a0aaafa7b893f2f7d21f47;hp=3dcd54daa867b162d4dc9fc72aeacc202f390213;hpb=e0d54dd3b497b78094ea16ab0f38ccdc8c1642e2;p=lyx.git 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; }