From: Enrico Forestieri Date: Wed, 26 Mar 2008 22:38:41 +0000 (+0000) Subject: Fix bug 4665: X-Git-Tag: 1.6.10~5401 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=958b6b7069dd05d3404a2dcfc0556f4cedd8b2ce;p=features.git Fix bug 4665: http://bugzilla.lyx.org/show_bug.cgi?id=4665 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23989 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/output_latex.cpp b/src/output_latex.cpp index ea4418fe0a..5706a4456d 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -699,16 +699,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.