X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput_latex.cpp;h=7e99809ccb4ec63d63bd713955e393ec0854515c;hb=8a69ffd3bfaa4ab23b281a38b9a65f0a8550c997;hp=ea4418fe0a5ad7e7e79746d084fba11c904dc03e;hpb=62d5a54ae7090ae406764f31be53873cd1eaccfe;p=lyx.git diff --git a/src/output_latex.cpp b/src/output_latex.cpp index ea4418fe0a..7e99809ccb 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -30,6 +30,7 @@ #include "insets/InsetBibitem.h" #include "insets/InsetOptArg.h" +#include "support/assert.h" #include "support/debug.h" #include "support/lstrings.h" @@ -38,11 +39,11 @@ using namespace std; using namespace lyx::support; + namespace lyx { namespace { - enum OpenEncoding { none, inputenc, @@ -699,16 +700,12 @@ TeXOnePar(Buffer const & buf, } // If this is the last paragraph, and a local_font was set upon entering - // the inset, the encoding should be set back to that local_font's - // encoding. We don't use switchEncoding(), because no explicit encoding - // switch command is needed, since latex will automatically revert to it - // when this inset closes. - // This switch is only necessary if we're using "auto" or "default" - // encoding. - if (nextpit == paragraphs.end() && runparams_in.local_font != 0) { + // the inset, and we're using "auto" or "default" encoding, the encoding + // should be set back to that local_font's encoding. + if (nextpit == paragraphs.end() && runparams_in.local_font != 0 + && (bparams.inputenc == "auto" || bparams.inputenc == "default")) { runparams_in.encoding = runparams_in.local_font->language()->encoding(); - if (bparams.inputenc == "auto" || bparams.inputenc == "default") - os << setEncoding(runparams_in.encoding->iconvName()); + os << setEncoding(runparams_in.encoding->iconvName()); } // Otherwise, the current encoding should be set for the next paragraph. @@ -749,7 +746,7 @@ void latexParagraphs(Buffer const & buf, ParagraphList::const_iterator par = paragraphs.begin(); ParagraphList::const_iterator endpar = paragraphs.end(); - BOOST_ASSERT(runparams.par_begin <= runparams.par_end); + LASSERT(runparams.par_begin <= runparams.par_end, /**/); // if only part of the paragraphs will be outputed if (runparams.par_begin != runparams.par_end) { par = boost::next(paragraphs.begin(), runparams.par_begin);