]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Accelerators
[lyx.git] / src / Paragraph.cpp
index 8ef7c20e75720fdf2c62b5c26b173c07fc46d15d..2465cc4101e88c425c616bd3152965fa69fa52e6 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;
                        }
                }
 
@@ -4542,7 +4544,7 @@ Language * Paragraph::Private::locateSpellRange(
                // hop to end of word
                while (last < to && !owner_->isWordSeparator(last)) {
                        Inset const * inset = owner_->getInset(last);
-                       if (inset && inset->lyxCode() == SPECIALCHAR_CODE) {
+                       if (inset && dynamic_cast<const InsetSpecialChar *>(inset)) {
                                // check for "invisible" letters such as ligature breaks
                                odocstringstream os;
                                inset->toString(os);