From 833e7085dde3a361b92caeb36beb79232f748e70 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 9 Jan 2010 16:57:08 +0000 Subject: [PATCH] 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 --- src/BiblioInfo.cpp | 6 ------ src/BiblioInfo.h | 4 ---- src/frontends/qt4/GuiCitation.cpp | 2 +- src/insets/InsetCitation.cpp | 4 ++-- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index bb9b27f7fe..5fee10ccc2 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -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_) { diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h index 658a4ad027..150e77f0c4 100644 --- a/src/BiblioInfo.h +++ b/src/BiblioInfo.h @@ -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(); } diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 8c653d88f8..7fc2cf5d99 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -707,7 +707,7 @@ vector 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()) diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp index d88c8761d8..6c5499e7eb 100644 --- a/src/insets/InsetCitation.cpp +++ b/src/insets/InsetCitation.cpp @@ -217,8 +217,8 @@ docstring complexLabel(Buffer const & buffer, vector::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())