Fix isDefaultBiblio() test

This commit is contained in:
Juergen Spitzmueller 2016-12-31 16:01:11 +01:00
parent adc93015f9
commit c76ce9fae8

View File

@ -138,10 +138,15 @@ string LyXCiteEngine::getDefaultBiblio(CiteEngineType const & cet) const
bool LyXCiteEngine::isDefaultBiblio(string const & bf) const bool LyXCiteEngine::isDefaultBiblio(string const & bf) const
{ {
if (find(default_biblios_.begin(), default_biblios_.end(), bf) != default_biblios_.end()) string const bfs = ":" + bf;
return true; vector<string>::const_iterator it = default_biblios_.begin();
string const bfp = ":" + bf; vector<string>::const_iterator end = default_biblios_.end();
return find(default_biblios_.begin(), default_biblios_.end(), bfp) != default_biblios_.end(); for (; it != end; ++it) {
string const s = *it;
if (suffixIs(s, bfs) || bf == s)
return true;
}
return false;
} }