From: Abdelrazak Younes Date: Wed, 15 Dec 2010 21:48:00 +0000 (+0000) Subject: get rid of TeXDeeper: this was hiding the recursiveness of TeXEnvironment without... X-Git-Tag: 2.0.0~1363 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1ff5754a1b2f1196b97d8c20f6d091bda9c4cfe3;p=features.git get rid of TeXDeeper: this was hiding the recursiveness of TeXEnvironment without any real benefits. This will allow further simplification of the code. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36895 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 6c40c38a8f..de21ae4fa3 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -56,49 +56,6 @@ static int cjk_inherited_ = 0; Language const * prev_env_language_ = 0; -ParagraphList::const_iterator -TeXEnvironment(Buffer const & buf, - Text const & text, - ParagraphList::const_iterator pit, - odocstream & os, TexRow & texrow, - OutputParams const & runparams); - - -ParagraphList::const_iterator -TeXDeeper(Buffer const & buf, - Text const & text, - ParagraphList::const_iterator pit, - odocstream & os, TexRow & texrow, - OutputParams const & runparams) -{ - LYXERR(Debug::LATEX, "TeXDeeper... " << &*pit); - ParagraphList::const_iterator par = pit; - - ParagraphList const & paragraphs = text.paragraphs(); - - bool const force_plain_layout = text.inset().forcePlainLayout(); - depth_type const max_depth = pit->params().depth(); - // FIXME: move that to a for loop! - while (par != paragraphs.end() && par->params().depth() == max_depth) { - // FIXME This test should not be necessary. - // We should perhaps issue an error if it is. - Layout const & style = force_plain_layout - ? buf.params().documentClass().plainLayout() : par->layout(); - if (style.isEnvironment()) { - par = TeXEnvironment(buf, text, par, - os, texrow, runparams); - } else { - TeXOnePar(buf, text, par, os, texrow, runparams); - if (par != text.paragraphs().end()) - par++; - } - } - LYXERR(Debug::LATEX, "TeXDeeper...done "); - - return par; -} - - string const getPolyglossiaEnvName(Language const * lang) { string result = lang->polyglossia(); @@ -265,9 +222,30 @@ TeXEnvironment(Buffer const & buf, os << '\n'; texrow.newline(); } - par = TeXDeeper(buf, text, par, os, texrow, - runparams); + + LYXERR(Debug::LATEX, "TeXDeeper... " << &*par); + bool const force_plain_layout = text.inset().forcePlainLayout(); + depth_type const max_depth = par->params().depth(); + + // FIXME: move that to a for loop! + while (par != paragraphs.end() + && par->params().depth() == max_depth) { + // FIXME This test should not be necessary. + // We should perhaps issue an error if it is. + Layout const & style = force_plain_layout + ? buf.params().documentClass().plainLayout() : par->layout(); + if (style.isEnvironment()) { + // Recursive call to TeXEnvironment! + par = TeXEnvironment(buf, text, par, os, texrow, runparams); + } else { + TeXOnePar(buf, text, par, os, texrow, runparams); + if (par != text.paragraphs().end()) + par++; + } + } + LYXERR(Debug::LATEX, "TeXDeeper...done "); } + } while (par != paragraphs.end() && par->layout() == pit->layout() && par->params().depth() == pit->params().depth()