From 6445cd9df49347b275d633ff905667d2fd0ced13 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 20 Jul 2013 16:15:47 +0200 Subject: [PATCH] Bug in 'Use non-tex fonts' checkbox auto-toggling (#8717) --- src/frontends/qt4/GuiDocument.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 4fd3d53bab..80b41595c0 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -149,6 +149,7 @@ RGBColor set_fontcolor; bool is_fontcolor; RGBColor set_notefontcolor; RGBColor set_boxbgcolor; +bool forced_fontspec_activation; namespace { // used when sorting the textclass list. @@ -1735,11 +1736,22 @@ void GuiDocument::languageChanged(int i) Language const * lang = lyx::languages.getLanguage( fromqstr(langModule->languageCO->itemData(i).toString())); if (lang->babel().empty() && !lang->polyglossia().empty()) { + // If we force to switch fontspec on, store + // current state (#8717) + if (fontModule->osFontsCB->isEnabled()) + forced_fontspec_activation = + !fontModule->osFontsCB->isChecked(); fontModule->osFontsCB->setChecked(true); fontModule->osFontsCB->setEnabled(false); } - else + else { fontModule->osFontsCB->setEnabled(true); + // If we have forced to switch fontspec on, + // restore previous state (#8717) + if (forced_fontspec_activation) + fontModule->osFontsCB->setChecked(false); + forced_fontspec_activation = false; + } // set appropriate quotation mark style if (!lang->quoteStyle().empty()) { @@ -1916,7 +1928,7 @@ void GuiDocument::updateFontlist() fontModule->fontsTypewriterCO->clear(); fontModule->fontsMathCO->clear(); - // With XeTeX, we have access to all system fonts, but not the LaTeX fonts + // With fontspec (XeTeX, LuaTeX), we have access to all system fonts, but not the LaTeX fonts if (fontModule->osFontsCB->isChecked()) { fontModule->fontsRomanCO->addItem(qt_("Default"), QString("default")); fontModule->fontsSansCO->addItem(qt_("Default"), QString("default")); -- 2.39.5