latex export optimisation step 1: There is no need for TeXOnePar to return a par iterator and to depend on that.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36893 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2010-12-15 20:51:25 +00:00
parent 40e705e699
commit fbcbeb5130
2 changed files with 21 additions and 17 deletions

View File

@ -87,8 +87,9 @@ TeXDeeper(Buffer const & buf,
par = TeXEnvironment(buf, text, par, par = TeXEnvironment(buf, text, par,
os, texrow, runparams); os, texrow, runparams);
} else { } else {
par = TeXOnePar(buf, text, par, TeXOnePar(buf, text, par, os, texrow, runparams);
os, texrow, runparams); if (par != text.paragraphs().end())
par++;
} }
} }
LYXERR(Debug::LATEX, "TeXDeeper...done "); LYXERR(Debug::LATEX, "TeXDeeper...done ");
@ -234,7 +235,9 @@ TeXEnvironment(Buffer const & buf,
ParagraphList::const_iterator par = pit; ParagraphList::const_iterator par = pit;
do { do {
par = TeXOnePar(buf, text, par, os, texrow, runparams); TeXOnePar(buf, text, par, os, texrow, runparams);
if (par != paragraphs.end())
par++;
if (par == paragraphs.end()) { if (par == paragraphs.end()) {
// Make sure that the last paragraph is // Make sure that the last paragraph is
@ -364,7 +367,7 @@ int latexArgInsets(Paragraph const & par, odocstream & os,
// FIXME: this should be anonymous // FIXME: this should be anonymous
ParagraphList::const_iterator TeXOnePar(Buffer const & buf, void TeXOnePar(Buffer const & buf,
Text const & text, Text const & text,
ParagraphList::const_iterator const pit, ParagraphList::const_iterator const pit,
odocstream & os, TexRow & texrow, odocstream & os, TexRow & texrow,
@ -388,7 +391,7 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
pit == paragraphs.end() ? pit : boost::next(pit); pit == paragraphs.end() ? pit : boost::next(pit);
if (style.inpreamble) if (style.inpreamble)
return nextpit; return;
OutputParams runparams = runparams_in; OutputParams runparams = runparams_in;
runparams.isLastPar = nextpit == paragraphs.end(); runparams.isLastPar = nextpit == paragraphs.end();
@ -418,7 +421,7 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
pit->latex(bparams, outerfont, os, texrow, pit->latex(bparams, outerfont, os, texrow,
runparams, start_pos, end_pos); runparams, start_pos, end_pos);
return nextpit; return;
} }
if (style.pass_thru) { if (style.pass_thru) {
@ -440,7 +443,7 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
} }
} }
return nextpit; return;
} }
// This paragraph's language // This paragraph's language
@ -903,7 +906,7 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
if (nextpit != paragraphs.end()) if (nextpit != paragraphs.end())
LYXERR(Debug::LATEX, "TeXOnePar...done " << &*nextpit); LYXERR(Debug::LATEX, "TeXOnePar...done " << &*nextpit);
return nextpit; return;
} }
@ -1012,8 +1015,9 @@ void latexParagraphs(Buffer const & buf,
par = TeXEnvironment(buf, text, par, os, par = TeXEnvironment(buf, text, par, os,
texrow, runparams); texrow, runparams);
} else { } else {
par = TeXOnePar(buf, text, par, os, texrow, TeXOnePar(buf, text, par, os, texrow, runparams, everypar);
runparams, everypar); if (par != paragraphs.end())
par++;
} }
if (distance(lastpar, par) >= distance(lastpar, endpar)) if (distance(lastpar, par) >= distance(lastpar, endpar))
break; break;

View File

@ -61,13 +61,13 @@ std::pair<bool, int> switchEncoding(odocstream & os,
bool force = false); bool force = false);
/// FIXME: this should not be visible. /// FIXME: this should not be visible.
ParagraphList::const_iterator TeXOnePar(Buffer const & buf, void TeXOnePar(Buffer const & buf,
Text const & text, Text const & text,
ParagraphList::const_iterator pit, ParagraphList::const_iterator pit,
odocstream & os, TexRow & texrow, odocstream & os, TexRow & texrow,
OutputParams const & runparams, OutputParams const & runparams,
std::string const & everypar = std::string(), std::string const & everypar = std::string(),
int start_pos = -1, int end_pos = -1); int start_pos = -1, int end_pos = -1);
} // namespace lyx } // namespace lyx