From 719ec62e28ee9ec6caaab5f0e89a62a180f45524 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 25 Aug 2012 10:48:37 +0200 Subject: [PATCH] Fix thinkos in LaTeX font reading --- src/LaTeXFonts.cpp | 6 ++++++ src/frontends/qt4/GuiDocument.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/LaTeXFonts.cpp b/src/LaTeXFonts.cpp index b165258439..b603f81ae2 100644 --- a/src/LaTeXFonts.cpp +++ b/src/LaTeXFonts.cpp @@ -394,8 +394,14 @@ LaTeXFonts::TexFontMap LaTeXFonts::getLaTeXFonts() LaTeXFont LaTeXFonts::getLaTeXFont(docstring const & name) { + if (name == "default") + return LaTeXFont(); if (texfontmap_.empty()) readLaTeXFonts(); + if (texfontmap_.find(name) == texfontmap_.end()) { + LYXERR0("LaTeXFonts::getLaTeXFont: font '" << name << "' not found!"); + return LaTeXFont(); + } return texfontmap_[name]; } diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index ee398096dc..6ccc86e879 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -1840,8 +1840,10 @@ void GuiDocument::updateTexFonts() LaTeXFonts::TexFontMap::const_iterator end = texfontmap.end(); for (; it != end; ++it) { LaTeXFont lf = it->second; - if (lf.name().empty()) - return; + if (lf.name().empty()) { + LYXERR0("Error: Unnamed font: " << it->first); + continue; + } docstring const family = lf.family(); docstring guiname = translateIfPossible(lf.guiname()); if (!lf.available(ot1()))