From 8bfda1f950ef59951967d89bdc2cacdc1fecbfaf Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Tue, 5 Mar 2002 17:48:21 +0000 Subject: [PATCH] Don't call parseBibTeX at all if the info field is from lyx layout "bibliography" (from Herbert). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3671 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/ChangeLog | 4 ++++ src/frontends/controllers/biblio.C | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index cb8846e623..e5ed0f2734 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2002-03-05 Herbert Voss + + biblio.C: (getInfo) simplify if using paragraph layout "bibliography". + 2002-03-05 Angus Leeming * biblio.C (getInfo): return the info field correctly if the key diff --git a/src/frontends/controllers/biblio.C b/src/frontends/controllers/biblio.C index 110c069e75..5f64ba6e10 100644 --- a/src/frontends/controllers/biblio.C +++ b/src/frontends/controllers/biblio.C @@ -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;