Fix bug #7463: XHTML View>Source now shows only the paragraph with the

cursor. Fix is fairly simple.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38572 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2011-05-03 14:05:42 +00:00
parent 173401248a
commit 7d9b8a464f

View File

@ -922,11 +922,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
@ -935,7 +944,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) {
@ -972,10 +981,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);
}
}