small fix to ControlCitation

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1797 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2001-03-20 12:59:37 +00:00
parent 9f29ab3aa5
commit 1e4e0efe0e
2 changed files with 18 additions and 11 deletions

View 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> 2001-03-20 Angus Leeming <a.leeming@ic.ac.uk>
* ControlLog.[Ch]: * ControlLog.[Ch]:

View File

@ -89,23 +89,23 @@ string const ControlCitation::getBibkeyInfo(string const & key)
InfoMap::const_iterator it = bibkeysInfo_.find(key); InfoMap::const_iterator it = bibkeysInfo_.find(key);
if (it != bibkeysInfo_.end()) { if (it != bibkeysInfo_.end()) {
// Search for all possible "required" keys // Search for all possible "required" keys
string author = parseBibTeX((*it).second, "author"); string author = parseBibTeX(it->second, "author");
if (author.empty()) if (author.empty())
author = parseBibTeX((*it).second, "editor"); author = parseBibTeX(it->second, "editor");
string year = parseBibTeX((*it).second, "year"); string year = parseBibTeX(it->second, "year");
string title = parseBibTeX((*it).second, "title"); string title = parseBibTeX(it->second, "title");
string booktitle = parseBibTeX((*it).second, "booktitle"); string booktitle = parseBibTeX(it->second, "booktitle");
string chapter = parseBibTeX((*it).second, "chapter"); string chapter = parseBibTeX(it->second, "chapter");
string pages = parseBibTeX((*it).second, "pages"); string pages = parseBibTeX(it->second, "pages");
string media = parseBibTeX((*it).second, "journal"); string media = parseBibTeX(it->second, "journal");
if (media.empty()) if (media.empty())
media = parseBibTeX((*it).second, "publisher"); media = parseBibTeX(it->second, "publisher");
if (media.empty()) if (media.empty())
media = parseBibTeX((*it).second, "school"); media = parseBibTeX(it->second, "school");
if (media.empty()) if (media.empty())
media = parseBibTeX((*it).second, "institution"); media = parseBibTeX(it->second, "institution");
result = author; result = author;
if (!year.empty()) if (!year.empty())
@ -120,6 +120,9 @@ string const ControlCitation::getBibkeyInfo(string const & key)
result += ", " + media; result += ", " + media;
if (!pages.empty()) if (!pages.empty())
result += ", pp. " + pages; result += ", pp. " + pages;
if (result.empty()) // not a BibTeX record
result = it->second;
} }
return result; return result;