* 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
This commit is contained in:
Stefan Schimanski 2007-06-13 07:43:34 +00:00
parent fd44c4ffdf
commit b06797a312

View File

@ -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;
}