]> git.lyx.org Git - features.git/commitdiff
small fix to ControlCitation
authorAngus Leeming <leeming@lyx.org>
Tue, 20 Mar 2001 12:59:37 +0000 (12:59 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 20 Mar 2001 12:59:37 +0000 (12:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1797 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlCitation.C

index dfb923b5ba91414321473a9cbc468683cc879c4e..4aca29f7ca7a6243c4fe80fb6f15aec242fdbea4 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-20  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * ControlCitation.C (getBibkeyInfo): parse non-BibTeX entries correctly.
+
 2001-03-20  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * ControlLog.[Ch]:
index 954042f5f50414f723058c24a903e1e148fdd4d6..9e25086f29821eb0b46ffb5ad0f58281765b8d0b 100644 (file)
@@ -89,23 +89,23 @@ string const ControlCitation::getBibkeyInfo(string const & key)
                InfoMap::const_iterator it = bibkeysInfo_.find(key);
        if (it != bibkeysInfo_.end()) {
                // Search for all possible "required" keys
-               string author = parseBibTeX((*it).second, "author");
+               string author = parseBibTeX(it->second, "author");
                if (author.empty())
-                       author = parseBibTeX((*it).second, "editor");
+                       author = parseBibTeX(it->second, "editor");
 
-               string year       = parseBibTeX((*it).second, "year");
-               string title      = parseBibTeX((*it).second, "title");
-               string booktitle  = parseBibTeX((*it).second, "booktitle");
-               string chapter    = parseBibTeX((*it).second, "chapter");
-               string pages      = parseBibTeX((*it).second, "pages");
+               string year       = parseBibTeX(it->second, "year");
+               string title      = parseBibTeX(it->second, "title");
+               string booktitle  = parseBibTeX(it->second, "booktitle");
+               string chapter    = parseBibTeX(it->second, "chapter");
+               string pages      = parseBibTeX(it->second, "pages");
 
-               string media      = parseBibTeX((*it).second, "journal");
+               string media      = parseBibTeX(it->second, "journal");
                if (media.empty())
-                       media = parseBibTeX((*it).second, "publisher");
+                       media = parseBibTeX(it->second, "publisher");
                if (media.empty())
-                       media = parseBibTeX((*it).second, "school");
+                       media = parseBibTeX(it->second, "school");
                if (media.empty())
-                       media = parseBibTeX((*it).second, "institution");
+                       media = parseBibTeX(it->second, "institution");
 
                result = author;
                if (!year.empty())
@@ -120,6 +120,9 @@ string const ControlCitation::getBibkeyInfo(string const & key)
                        result += ", " + media;
                if (!pages.empty())
                        result += ", pp. " + pages;
+
+               if (result.empty()) // not a BibTeX record
+                       result = it->second;
        }
 
        return result;