]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
Get rid of all-insets-toggle and explain how to replace it with inset-forall.
[lyx.git] / src / output_latex.cpp
index 5457dee3dfdd6ec0331f61a250cb370021b398ae..cdd42aaf4325222dffc0f18efff4d343bca6e20c 100644 (file)
@@ -348,8 +348,6 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
        Layout const style = text.inset().forcePlainLayout() ?
                bparams.documentClass().plainLayout() : pit->layout();
 
-       runparams.moving_arg |= style.needprotect;
-
        // This paragraph's language
        Language const * const par_language = pit->getParLanguage(bparams);
        // The document's language
@@ -462,7 +460,9 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
                // Look ahead for future encoding changes.
                // We try to output them at the beginning of the paragraph,
                // since the \inputencoding command is not allowed e.g. in
-               // sections.
+               // sections. For this reason we only set runparams.moving_arg
+               // after checking for the encoding change, otherwise the
+               // change would be always avoided by switchEncoding().
                for (pos_type i = 0; i < pit->size(); ++i) {
                        char_type const c = pit->getChar(i);
                        Encoding const * const encoding =
@@ -513,6 +513,7 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
                }
        }
 
+       runparams.moving_arg |= style.needprotect;
        Encoding const * const prev_encoding = runparams.encoding;
 
        bool const useSetSpace = bparams.documentClass().provides("SetSpace");