]> git.lyx.org Git - features.git/commitdiff
Do not attempt to close language twice
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 21 Aug 2020 09:07:22 +0000 (11:07 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 21 Aug 2020 09:07:22 +0000 (11:07 +0200)
src/Paragraph.cpp

index 8ef7c20e75720fdf2c62b5c26b173c07fc46d15d..d1c7fe9dfacd0c311298cb8a2df3115e60164475 100644 (file)
@@ -2615,6 +2615,7 @@ void Paragraph::latex(BufferParams const & bparams,
                }
 
                // Do we need to close the previous font?
+               bool langClosed = false;
                if (open_font &&
                    ((current_font != running_font
                      || current_font.language() != running_font.language())
@@ -2650,6 +2651,7 @@ void Paragraph::latex(BufferParams const & bparams,
                        }
                        running_font = basefont;
                        open_font = false;
+                       langClosed = true;
                }
 
                // if necessary, close language environment before opening CJK
@@ -2749,7 +2751,7 @@ void Paragraph::latex(BufferParams const & bparams,
                                }
                        } else {
                                running_font = current_font;
-                               open_font = true;
+                               open_font = !langClosed;
                        }
                }