mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
A little cleanup of some of the BibTeX info access.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32915 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f223e4ff63
commit
833e7085dd
@ -208,12 +208,6 @@ BibTeXInfo::BibTeXInfo(docstring const & key, docstring const & type)
|
||||
{}
|
||||
|
||||
|
||||
bool BibTeXInfo::hasField(docstring const & field) const
|
||||
{
|
||||
return count(field) == 1;
|
||||
}
|
||||
|
||||
|
||||
docstring const BibTeXInfo::getAbbreviatedAuthor() const
|
||||
{
|
||||
if (!is_bibtex_) {
|
||||
|
@ -53,8 +53,6 @@ public:
|
||||
BibTeXInfo(bool ib) : is_bibtex_(ib) {}
|
||||
/// constructor that sets the entryType
|
||||
BibTeXInfo(docstring const & key, docstring const & type);
|
||||
///
|
||||
bool hasField(docstring const & field) const;
|
||||
/// \return the short form of an authorlist
|
||||
docstring const getAbbreviatedAuthor() const;
|
||||
///
|
||||
@ -65,8 +63,6 @@ public:
|
||||
/// \param pointer to crossref information
|
||||
docstring const & getInfo(BibTeXInfo const * const xref = 0) const;
|
||||
///
|
||||
int count(docstring const & f) const { return bimap_.count(f); }
|
||||
///
|
||||
const_iterator find(docstring const & f) const { return bimap_.find(f); }
|
||||
///
|
||||
const_iterator end() const { return bimap_.end(); }
|
||||
|
@ -707,7 +707,7 @@ vector<docstring> GuiCitation::searchKeys(BiblioInfo const & bi,
|
||||
data = to_utf8(*it);
|
||||
else if (field.empty())
|
||||
data = to_utf8(*it) + ' ' + to_utf8(kvm.allData());
|
||||
else if (kvm.hasField(field))
|
||||
else
|
||||
data = to_utf8(kvm[field]);
|
||||
|
||||
if (data.empty())
|
||||
|
@ -217,8 +217,8 @@ docstring complexLabel(Buffer const & buffer,
|
||||
vector<docstring>::const_iterator end = keys.end();
|
||||
for (; it != end; ++it) {
|
||||
// get the bibdata corresponding to the key
|
||||
docstring const author(biblist.getAbbreviatedAuthor(*it));
|
||||
docstring const year(biblist.getYear(*it));
|
||||
docstring const author = biblist.getAbbreviatedAuthor(*it);
|
||||
docstring const year = biblist.getYear(*it);
|
||||
|
||||
// Something isn't right. Fail safely.
|
||||
if (author.empty() || year.empty())
|
||||
|
Loading…
Reference in New Issue
Block a user