From a4ea17e0e975827d3d38b41088e5d07f8b1cfd59 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Thu, 7 Jun 2012 21:27:01 +0200 Subject: [PATCH] Restore default output format after tex fonts switch (#8191) --- src/frontends/qt4/GuiDocument.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index ba55eb2fda..164fe9341e 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -1761,7 +1761,16 @@ void GuiDocument::osFontsChanged(bool nontexfonts) { bool const tex_fonts = !nontexfonts; updateFontlist(); + // store default format + QString const dformat = outputModule->defaultFormatCO->itemData( + outputModule->defaultFormatCO->currentIndex()).toString(); updateDefaultFormat(); + // try to restore default format + int index = outputModule->defaultFormatCO->findData(dformat); + // set to default if format is not found + if (index == -1) + index = 0; + outputModule->defaultFormatCO->setCurrentIndex(index); langModule->encodingCO->setEnabled(tex_fonts && !langModule->defaultencodingRB->isChecked()); langModule->defaultencodingRB->setEnabled(tex_fonts);