X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCiteEnginesList.cpp;h=6a1cef1a1185c97421f6a9750ad33003c74fafef;hb=4a7a19352cabb401052ca9467cf849da78f82f1a;hp=2b8de0525546952bfef69a25fa059f93bfa64be6;hpb=74f774d6cf18a897deb533d3afc697abb31f824e;p=lyx.git diff --git a/src/CiteEnginesList.cpp b/src/CiteEnginesList.cpp index 2b8de05255..6a1cef1a11 100644 --- a/src/CiteEnginesList.cpp +++ b/src/CiteEnginesList.cpp @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Richard Heck + * \author Richard Kimberly Heck * \author Jürgen Spitzmüller * * Full author contact details are available in file CREDITS. @@ -14,7 +14,6 @@ #include "CiteEnginesList.h" -#include "Citation.h" #include "LaTeXFeatures.h" #include "Lexer.h" @@ -102,7 +101,7 @@ string LyXCiteEngine::getDefaultBiblio(CiteEngineType const & cet) const bool LyXCiteEngine::isDefaultBiblio(string const & bf) const { string const bfs = ":" + bf; - for (string const &s: default_biblios_) + for (string const & s: default_biblios_) if (suffixIs(s, bfs) || bf == s) return true; @@ -110,6 +109,12 @@ bool LyXCiteEngine::isDefaultBiblio(string const & bf) const } +bool LyXCiteEngine::required(string const & p) const +{ + return find(package_list_.begin(), package_list_.end(), p) != package_list_.end(); +} + + // used when sorting the cite engine list. class EngineSorter { public: @@ -142,7 +147,7 @@ CiteEngineTypeTranslator const & citeenginetypetranslator() return translator; } -} // namespace anon +} // namespace string CiteEnginesList::getTypeAsString(CiteEngineType const & et) const @@ -288,25 +293,21 @@ LyXCiteEnginesList::iterator CiteEnginesList::end() LyXCiteEngine const * CiteEnginesList::operator[](string const & str) const { - LyXCiteEnginesList::const_iterator it = englist_.begin(); - for (; it != englist_.end(); ++it) - if (it->getID() == str) { - LyXCiteEngine const & eng = *it; + for (auto const & eng : englist_) + if (eng.getID() == str) { return ŋ } - return 0; + return nullptr; } LyXCiteEngine * CiteEnginesList::operator[](string const & str) { - LyXCiteEnginesList::iterator it = englist_.begin(); - for (; it != englist_.end(); ++it) - if (it->getID() == str) { - LyXCiteEngine & eng = *it; + for (auto & eng : englist_) + if (eng.getID() == str) { return ŋ } - return 0; + return nullptr; } } // namespace lyx