From b32615d1ce77071b75b87a4a39c3a912a6c51619 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 16 Aug 2019 11:48:57 +0200 Subject: [PATCH] Tiny cleanup No change in functionality --- src/Paragraph.cpp | 2 +- src/output_latex.cpp | 36 +++++++++++++++++------------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 311e952807..eb2bb9548c 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -2748,7 +2748,7 @@ void Paragraph::latex(BufferParams const & bparams, runparams.post_macro = rp.post_macro; } - // Close wrapper for alien script + // Close wrapper for alien script if (!alien_script.empty()) { os << "}"; alien_script.clear(); diff --git a/src/output_latex.cpp b/src/output_latex.cpp index d320e0efe6..0866317702 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -780,7 +780,7 @@ void TeXOnePar(Buffer const & buf, Paragraph const * nextpar = runparams.isLastPar ? nullptr : ¶graphs.at(pit + 1); - bool const intitle_command = style.intitle && style.latextype == LATEX_COMMAND; + bool const intitle_command = style.intitle && style.isCommand(); if (style.pass_thru) { Font const outerfont = text.outerFont(pit); @@ -847,7 +847,7 @@ void TeXOnePar(Buffer const & buf, && priorpar->layout().isEnvironment() && (priorpar->getDepth() > par.getDepth() || (priorpar->getDepth() == par.getDepth() - && priorpar->layout() != par.layout())); + && priorpar->layout() != par.layout())); Language const * const prev_language = runparams_in.for_search ? languages.getLanguage("ignore") @@ -1282,23 +1282,21 @@ void TeXOnePar(Buffer const & buf, // InTitle commands need to be closed after the language has been closed. if (intitle_command) { - if (is_command) { - os << '}'; - if (!style.postcommandargs().empty()) - latexArgInsets(par, os, runparams, style.postcommandargs(), "post:"); - if (!runparams.post_macro.empty()) { - // Output the stored fragile commands (labels, indices etc.) - // that need to be output after the command with moving argument. - os << runparams.post_macro; - runparams.post_macro.clear(); - } - if (par.needsCProtection(runparams.moving_arg) - && contains(runparams.active_chars, '^')) - os << "\\endgroup"; - if (runparams.encoding != prev_encoding) { - runparams.encoding = prev_encoding; - os << setEncoding(prev_encoding->iconvName()); - } + os << '}'; + if (!style.postcommandargs().empty()) + latexArgInsets(par, os, runparams, style.postcommandargs(), "post:"); + if (!runparams.post_macro.empty()) { + // Output the stored fragile commands (labels, indices etc.) + // that need to be output after the command with moving argument. + os << runparams.post_macro; + runparams.post_macro.clear(); + } + if (par.needsCProtection(runparams.moving_arg) + && contains(runparams.active_chars, '^')) + os << "\\endgroup"; + if (runparams.encoding != prev_encoding) { + runparams.encoding = prev_encoding; + os << setEncoding(prev_encoding->iconvName()); } }