commit 4cbd28e3fe656d02934af3fa197f468e02b1ed07
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Sat Dec 31 16:01:11 2016 +0100

    Fix isDefaultBiblio() test
---
 src/CiteEnginesList.cpp |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/CiteEnginesList.cpp b/src/CiteEnginesList.cpp
index 0e3f455..ee72875 100644
--- a/src/CiteEnginesList.cpp
+++ b/src/CiteEnginesList.cpp
@@ -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;
 }
 
 

Reply via email to