]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
reorder.
[lyx.git] / src / output_latex.cpp
index 99843639632c1e539cd5ba2213fb999dbb636c5b..534bf48be4bf217360674612de12b7e42c0d2cc9 100644 (file)
@@ -442,11 +442,8 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
                        // With CJK, only add switch if we have CJK content at the beginning
                        // of the paragraph
                        if (encoding->package() != Encoding::CJK || i == 0) {
-                               OutputParams tmp_rp = runparams;
-                               runparams.moving_arg = false;
                                pair<bool, int> enc_switch = switchEncoding(os, bparams, runparams,
                                        *encoding);
-                               runparams = tmp_rp;
                                // the following is necessary after a CJK environment in a multilingual
                                // context (nesting issue).
                                if (par_language->encoding()->package() == Encoding::CJK &&
@@ -580,7 +577,7 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
                        break;
        }
 
-               // fall through possible
+       // fall through possible
        default:
                // we don't need it for the last paragraph!!!
                if (nextpit != paragraphs.end())
@@ -700,9 +697,11 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
        // If this is the last paragraph, and a local_font was set upon entering
        // the inset, and we're using "auto" or "default" encoding, the encoding
        // should be set back to that local_font's encoding.
+       // However, do not change the encoding when XeTeX is used.
        if (nextpit == paragraphs.end() && runparams_in.local_font != 0
            && runparams_in.encoding != runparams_in.local_font->language()->encoding()
-           && (bparams.inputenc == "auto" || bparams.inputenc == "default")) {
+           && (bparams.inputenc == "auto" || bparams.inputenc == "default")
+           && (!bparams.useXetex)) {
                runparams_in.encoding = runparams_in.local_font->language()->encoding();
                os << setEncoding(runparams_in.encoding->iconvName());
        }
@@ -798,8 +797,7 @@ void latexParagraphs(Buffer const & buf,
                // FIXME This check should not be needed. We should
                // perhaps issue an error if it is.
                Layout const & layout = par->forcePlainLayout() ?
-                               tclass.plainLayout() :
-                               par->layout();
+                               tclass.plainLayout() : par->layout();
 
                if (layout.intitle) {
                        if (already_title) {