]> git.lyx.org Git - features.git/commitdiff
Don't call parseBibTeX at all if the info field is from lyx layout
authorAngus Leeming <leeming@lyx.org>
Tue, 5 Mar 2002 17:48:21 +0000 (17:48 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 5 Mar 2002 17:48:21 +0000 (17:48 +0000)
"bibliography" (from Herbert).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3671 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/biblio.C

index cb8846e623d68a5de4e100ea71ada4e891bb1e86..e5ed0f273428986fa36b1004bd6e2a2a053e375c 100644 (file)
@@ -1,3 +1,7 @@
+2002-03-05  Herbert Voss  <voss@lyx.org>
+
+       biblio.C: (getInfo) simplify if using paragraph layout "bibliography".
+
 2002-03-05  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * biblio.C (getInfo): return the info field correctly if the key
index 110c069e75afab1f9a6c05d6e5218504fe3f3347..5f64ba6e10aa142b0ec9da95ccf80a0d38921222 100644 (file)
@@ -242,7 +242,11 @@ string const getInfo(InfoMap const & map, string const & key)
        lyx::Assert(!map.empty());
 
                InfoMap::const_iterator it = map.find(key);
-       if (it == map.end()) return string();
+       if (it == map.end())
+               return string();
+       // is the entry a BibTeX one or one from lyx-layout "bibliography"?
+       if (!contains(it->second,'='))
+               return it->second.c_str();
 
        // Search for all possible "required" keys
        string author = parseBibTeX(it->second, "author");
@@ -287,7 +291,9 @@ string const getInfo(InfoMap const & map, string const & key)
 
        char const * const tmp = result.str().c_str();
        string result_str = tmp ? strip(tmp) : string();
-       if (result_str.empty()) // not a BibTeX record
+
+       if (result_str.empty())
+               // This should never happen (or at least be very unusual!)
                result_str = it->second;
 
        return result_str;