From 01d60968f9992a2958aa585b27a974f22f23a39f Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 17 Jan 2009 00:29:32 +0000 Subject: [PATCH] This can be a const ref now. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28194 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BiblioInfo.cpp | 7 ++++--- src/BiblioInfo.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index be8c369ab6..471740dc2d 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -292,7 +292,7 @@ namespace { } // anon namespace -docstring const BibTeXInfo::getInfo(BibTeXInfo const * const xref) const +docstring const & BibTeXInfo::getInfo(BibTeXInfo const * const xref) const { if (!info_.empty()) return info_; @@ -304,7 +304,7 @@ docstring const BibTeXInfo::getInfo(BibTeXInfo const * const xref) const } // FIXME - // This could be made a lot better using the entryType + // This could be made a lot better using the entry_type_ // field to customize the output based upon entry type. // Search for all possible "required" fields @@ -353,7 +353,8 @@ docstring const BibTeXInfo::getInfo(BibTeXInfo const * const xref) const } // This should never happen (or at least be very unusual!) - return docstring(); + static docstring e = docstring(); + return e; } diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h index 9ebc866ec6..b311a36a6c 100644 --- a/src/BiblioInfo.h +++ b/src/BiblioInfo.h @@ -63,7 +63,7 @@ public: docstring const getXRef() const; /// \return formatted BibTeX data suitable for framing. /// \param pointer to crossref information - docstring const getInfo(BibTeXInfo const * const xref = 0) const; + docstring const & getInfo(BibTeXInfo const * const xref = 0) const; /// int count(docstring const & f) const { return bimap_.count(f); } ///