]> git.lyx.org Git - features.git/commitdiff
A little cleanup of some of the BibTeX info access.
authorRichard Heck <rgheck@comcast.net>
Sat, 9 Jan 2010 16:57:08 +0000 (16:57 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 9 Jan 2010 16:57:08 +0000 (16:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32915 a592a061-630c-0410-9148-cb99ea01b6c8

src/BiblioInfo.cpp
src/BiblioInfo.h
src/frontends/qt4/GuiCitation.cpp
src/insets/InsetCitation.cpp

index bb9b27f7feab4b11993cedc35dcd0454ee5df9cd..5fee10ccc2743fac622048457f7417d1d9e3ed97 100644 (file)
@@ -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_) {
index 658a4ad02731da25504714e90a3eb009a56827a6..150e77f0c494bf301b806c48a8e0cb8812395083 100644 (file)
@@ -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(); }
index 8c653d88f825f0a4ca3f6b5236bd55d1399fc9a4..7fc2cf5d99f62da8f65bc24c83cc90823e02a439 100644 (file)
@@ -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())
index d88c8761d887a1b8aa7de097242bf7c7d9c30a52..6c5499e7eb5edbc1a278263809cd25061976c210 100644 (file)
@@ -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())