From: Enrico Forestieri Date: Sat, 27 Mar 2010 17:29:56 +0000 (+0000) Subject: Fix #6618: RTL (sub)*section after LTR text doesn't compile. X-Git-Tag: 2.0.0~3693 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f84a611775ab37d66918b40c52c81df9a871c798;p=features.git Fix #6618: RTL (sub)*section after LTR text doesn't compile. When deciding whether to switch encoding or not, the "fragileness" of the enclosing environment (rather than that of the actual one) should be taken into account, as we already account for the current "fragility" by outputting the encoding switch just before switching environment. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33882 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 5457dee3df..cdd42aaf43 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -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");