]> git.lyx.org Git - lyx.git/commitdiff
Fix isDefaultBiblio() test
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 31 Dec 2016 15:01:11 +0000 (16:01 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 1 Jan 2017 07:07:03 +0000 (08:07 +0100)
src/CiteEnginesList.cpp

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