Backport fix for #7463 to branch.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39210 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-06-29 13:32:28 +00:00
parent 034d57884e
commit 22db387d08

View File

@ -924,11 +924,20 @@ void xhtmlParagraphs(Text const & text,
OutputParams const & runparams)
{
ParagraphList const & paragraphs = text.paragraphs();
ParagraphList::const_iterator par = paragraphs.begin();
ParagraphList::const_iterator pend = paragraphs.end();
if (runparams.par_begin == runparams.par_end) {
runparams.par_begin = 0;
runparams.par_end = paragraphs.size();
}
pit_type bpit = runparams.par_begin;
pit_type const epit = runparams.par_end;
LASSERT(bpit < epit, /* */);
OutputParams ourparams = runparams;
while (par != pend) {
ParagraphList::const_iterator const pend =
(epit == (int) paragraphs.size()) ?
paragraphs.end() : paragraphs.constIterator(epit);
while (bpit < epit) {
ParagraphList::const_iterator par = paragraphs.constIterator(bpit);
if (par->params().startOfAppendix()) {
// FIXME: only the counter corresponding to toplevel
// sectioning should be reset
@ -937,7 +946,7 @@ void xhtmlParagraphs(Text const & text,
cnts.appendix(true);
}
Layout const & style = par->layout();
ParagraphList::const_iterator lastpar = par;
ParagraphList::const_iterator const lastpar = par;
ParagraphList::const_iterator send;
switch (style.latextype) {
@ -974,10 +983,7 @@ void xhtmlParagraphs(Text const & text,
par = makeParagraphs(buf, xs, ourparams, text, par, send);
break;
}
// FIXME??
// makeEnvironment may process more than one paragraphs and bypass pend
if (distance(lastpar, par) >= distance(lastpar, pend))
break;
bpit += distance(lastpar, par);
}
}