]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
* Rename HunspellSpellChecker to HunspellChecker and ASpell to AspellChecker for...
[lyx.git] / src / output_latex.cpp
index a98ffb8c154b2ef55250a926dca06a11467c337f..e62e2d77dbdc4a58b5543c6d4ae85833c591d2f6 100644 (file)
@@ -115,7 +115,8 @@ TeXEnvironment(Buffer const & buf,
        ParagraphList::const_iterator const priorpit =
                pit == paragraphs.begin() ? pit : boost::prior(pit);
 
-       bool const use_prev_env_language = priorpit->layout().isEnvironment()
+       bool const use_prev_env_language = prev_env_language_ != 0
+                       && priorpit->layout().isEnvironment()
                        && (priorpit->getDepth() > pit->getDepth()
                            || (priorpit->getDepth() == pit->getDepth()
                                && priorpit->layout() != pit->layout()));
@@ -352,7 +353,8 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
        // environment with nesting depth greater than (or equal to, but with
        // a different layout) the current one. If there is no previous
        // paragraph, the previous language is the outer language.
-       bool const use_prev_env_language = priorpit->layout().isEnvironment()
+       bool const use_prev_env_language = prev_env_language_ != 0
+                       && priorpit->layout().isEnvironment()
                        && (priorpit->getDepth() > pit->getDepth()
                            || (priorpit->getDepth() == pit->getDepth()
                                && priorpit->layout() != pit->layout()));