]> git.lyx.org Git - features.git/commitdiff
WYSIWYM citation labels for sub-standard BibTeX databases.
authorAngus Leeming <leeming@lyx.org>
Fri, 26 Apr 2002 14:35:04 +0000 (14:35 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 26 Apr 2002 14:35:04 +0000 (14:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4078 a592a061-630c-0410-9148-cb99ea01b6c8

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

index 36493308d85cca99b3d543ff05ba0ff8f00180af..638359f286d4395516bfb9a64621426276bb34fe 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-22  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * biblio.C (getAbbreviatedAuthor, getYear): Deal with sub-standard
+       BibTeX databases in a WYSIWYM way.
+
 2002-04-22  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * biblio.C (getAbbreviatedAuthor, getYear): Cæsar is dead. RIP; he was
index 102703263399772668115e6b4ba8adc8a1d3f217..ccbc6cdfc515a9bce01bd7c14ac9f29a0be8d7a1 100644 (file)
@@ -198,6 +198,13 @@ string const getAbbreviatedAuthor(InfoMap const & map, string const & key)
        if (author.empty())
                author = parseBibTeX(it->second, "editor");
 
+       if (author.empty()) {
+               author = parseBibTeX(it->second, "key");
+               if (author.empty())
+                       author = key;
+               return author;
+       }
+
        vector<string> authors = getVectorFromString(author, "and");
 
        if (!authors.empty()) {
@@ -247,6 +254,9 @@ string const getYear(InfoMap const & map, string const & key)
        }
 
        string year = parseBibTeX(it->second, "year");
+       if (year.empty())
+               year = _("No year");
+
        return year;
 }