Fix bug 3719: TOC skip-to points out of sync with document

http://bugzilla.lyx.org/show_bug.cgi?id=3719

The problem is that the full toc is not regenerated when creating standard (i.e unnembered) paragraph. As the TocBackEnd use ParIterator for in buffer jumps, this can get out of sync. The partial updateLabel() is my doing and comes before the TocBackend stuf. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19040 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-07-11 13:20:19 +00:00
parent 7e84dd3f9b
commit f1a6378d72
2 changed files with 3 additions and 27 deletions

View File

@ -644,12 +644,7 @@ void Text::breakParagraph(Cursor & cur, bool keep_layout)
break; // the character couldn't be deleted physically due to change tracking
}
ParIterator current_it(cur);
ParIterator last_it(cur);
++last_it;
++last_it;
updateLabels(cur.buffer(), current_it, last_it);
updateLabels(cur.buffer());
// A singlePar update is not enough in this case.
cur.updateFlags(Update::Force);

View File

@ -375,16 +375,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
recUndo(cur, pit, pit + 1);
finishUndo();
std::swap(pars_[pit], pars_[pit + 1]);
ParIterator begin(cur);
// begin.pos() (== cur.pos()) may point beyond the end of the
// paragraph referenced by begin. This would cause a crash
// in updateLabels()
begin.pos() = 0;
++cur.pit();
ParIterator end = boost::next(ParIterator(cur));
updateLabels(cur.buffer(), begin, end);
updateLabels(cur.buffer());
needsUpdate = true;
break;
}
@ -394,17 +385,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
recUndo(cur, pit - 1, pit);
finishUndo();
std::swap(pars_[pit], pars_[pit - 1]);
ParIterator end = ParIterator(cur);
// end.pos() (== cur.pos()) may point beyond the end of the
// paragraph referenced by end. This would cause a crash
// in boost::next()
end.pos() = 0;
end = boost::next(end);
--cur.pit();
ParIterator begin(cur);
updateLabels(cur.buffer(), begin, end);
updateLabels(cur.buffer());
needsUpdate = true;
break;
}