X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFonts.cpp;h=c9d030e8c343af500af6d0ac204da4c988bcbb43;hb=7067f48fa7afb89575abc58495d076078ce20137;hp=cb686349817e1683f62716985c416e0bdac977d5;hpb=715b8cda54a2aded29260b57ff201b16fd906f21;p=lyx.git diff --git a/src/LaTeXFonts.cpp b/src/LaTeXFonts.cpp index cb68634981..c9d030e8c3 100644 --- a/src/LaTeXFonts.cpp +++ b/src/LaTeXFonts.cpp @@ -35,13 +35,13 @@ namespace lyx { LaTeXFonts latexfonts; -LaTeXFont LaTeXFont::altFont(docstring const & name) +LaTeXFont LaTeXFont::altFont(docstring const & name) const { return theLaTeXFonts().getAltFont(name); } -bool LaTeXFont::available(bool ot1, bool nomath) +bool LaTeXFont::available(bool ot1, bool nomath) const { if (nomath && !nomathfont_.empty()) return altFont(nomathfont_).available(ot1, nomath); @@ -57,8 +57,8 @@ bool LaTeXFont::available(bool ot1, bool nomath) && LaTeXFeatures::isAvailable(to_ascii(package_))) return true; else if (!altfonts_.empty()) { - for (size_t i = 0; i < altfonts_.size(); ++i) { - if (altFont(altfonts_[i]).available(ot1, nomath)) + for (auto const & name : altfonts_) { + if (altFont(name).available(ot1, nomath)) return true; } } @@ -66,7 +66,7 @@ bool LaTeXFont::available(bool ot1, bool nomath) } -bool LaTeXFont::providesNoMath(bool ot1, bool complete) +bool LaTeXFont::providesNoMath(bool ot1, bool complete) const { docstring const usedfont = getUsedFont(ot1, complete, false, false); @@ -79,7 +79,7 @@ bool LaTeXFont::providesNoMath(bool ot1, bool complete) } -bool LaTeXFont::providesOSF(bool ot1, bool complete, bool nomath) +bool LaTeXFont::providesOSF(bool ot1, bool complete, bool nomath) const { docstring const usedfont = getUsedFont(ot1, complete, nomath, false); @@ -96,7 +96,7 @@ bool LaTeXFont::providesOSF(bool ot1, bool complete, bool nomath) } -bool LaTeXFont::providesSC(bool ot1, bool complete, bool nomath) +bool LaTeXFont::providesSC(bool ot1, bool complete, bool nomath) const { docstring const usedfont = getUsedFont(ot1, complete, nomath, false); @@ -111,7 +111,7 @@ bool LaTeXFont::providesSC(bool ot1, bool complete, bool nomath) } -bool LaTeXFont::hasMonolithicExpertSet(bool ot1, bool complete, bool nomath) +bool LaTeXFont::hasMonolithicExpertSet(bool ot1, bool complete, bool nomath) const { docstring const usedfont = getUsedFont(ot1, complete, nomath, false); @@ -124,7 +124,7 @@ bool LaTeXFont::hasMonolithicExpertSet(bool ot1, bool complete, bool nomath) } -bool LaTeXFont::providesScale(bool ot1, bool complete, bool nomath) +bool LaTeXFont::providesScale(bool ot1, bool complete, bool nomath) const { docstring const usedfont = getUsedFont(ot1, complete, nomath, false); @@ -138,7 +138,7 @@ bool LaTeXFont::providesScale(bool ot1, bool complete, bool nomath) } -bool LaTeXFont::providesMoreOptions(bool ot1, bool complete, bool nomath) +bool LaTeXFont::providesMoreOptions(bool ot1, bool complete, bool nomath) const { docstring const usedfont = getUsedFont(ot1, complete, nomath, false); @@ -152,7 +152,7 @@ bool LaTeXFont::providesMoreOptions(bool ot1, bool complete, bool nomath) return (moreopts_); } -bool LaTeXFont::provides(std::string const & name, bool ot1, bool complete, bool nomath) +bool LaTeXFont::provides(std::string const & name, bool ot1, bool complete, bool nomath) const { docstring const usedfont = getUsedFont(ot1, complete, nomath, false); @@ -163,15 +163,15 @@ bool LaTeXFont::provides(std::string const & name, bool ot1, bool complete, bool else if (provides_.empty()) return false; - for (size_t i = 0; i < provides_.size(); ++i) { - if (provides_[i] == name) + for (auto const & provide : provides_) { + if (provide == name) return true; } return false; } -docstring const LaTeXFont::getUsedFont(bool ot1, bool complete, bool nomath, bool osf) +docstring const LaTeXFont::getUsedFont(bool ot1, bool complete, bool nomath, bool osf) const { if (osf && osfFontOnly()) return osffont_; @@ -200,8 +200,8 @@ docstring const LaTeXFont::getUsedFont(bool ot1, bool complete, bool nomath, boo return name_; } else if (!altfonts_.empty()) { - for (size_t i = 0; i < altfonts_.size(); ++i) { - LaTeXFont altf = altFont(altfonts_[i]); + for (auto const & name : altfonts_) { + LaTeXFont altf = altFont(name); if (altf.available(ot1, nomath)) return altf.getUsedFont(ot1, complete, nomath, osf); } @@ -211,7 +211,7 @@ docstring const LaTeXFont::getUsedFont(bool ot1, bool complete, bool nomath, boo } -docstring const LaTeXFont::getUsedPackage(bool ot1, bool complete, bool nomath) +docstring const LaTeXFont::getUsedPackage(bool ot1, bool complete, bool nomath) const { docstring const usedfont = getUsedFont(ot1, complete, nomath, false); if (usedfont.empty()) @@ -220,7 +220,7 @@ docstring const LaTeXFont::getUsedPackage(bool ot1, bool complete, bool nomath) } -string const LaTeXFont::getAvailablePackage(bool dryrun) +string const LaTeXFont::getAvailablePackage(bool dryrun) const { if (package_.empty()) return string(); @@ -245,7 +245,7 @@ string const LaTeXFont::getAvailablePackage(bool dryrun) string const LaTeXFont::getPackageOptions(bool ot1, bool complete, bool sc, bool osf, - int scale, string const & extraopts, bool nomath) + int scale, string const & extraopts, bool nomath) const { ostringstream os; bool const needosfopt = (osf != osfdefault_); @@ -292,8 +292,7 @@ string const LaTeXFont::getPackageOptions(bool ot1, bool complete, bool sc, bool string const LaTeXFont::getLaTeXCode(bool dryrun, bool ot1, bool complete, bool sc, - bool osf, bool nomath, string const & extraopts, - int const & scale) + bool osf, bool nomath, string const & extraopts, int scale) const { ostringstream os;