Fix thinkos in LaTeX font reading

This commit is contained in:
Juergen Spitzmueller 2012-08-25 10:48:37 +02:00
parent e36e46b335
commit 719ec62e28
2 changed files with 10 additions and 2 deletions

View File

@ -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];
}

View File

@ -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()))