The branch, master, has been updated. - Log -----------------------------------------------------------------
commit 30f200a7e73b61c5b8c69f91ca8020c5b85c158b Author: Julien Rioux <[email protected]> Date: Tue Jan 8 16:20:52 2013 +0100 Fix cache for getInfo() with/without richtext (fixes #8486). diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index 4ad119c..a298999 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -577,8 +577,10 @@ docstring BibTeXInfo::expandFormat(string const & format, docstring const & BibTeXInfo::getInfo(BibTeXInfo const * const xref, Buffer const & buf, bool richtext) const { - if (!info_.empty()) + if (!richtext && !info_.empty()) return info_; + if (richtext && !info_richtext_.empty()) + return info_richtext_; if (!is_bibtex_) { BibTeXInfo::const_iterator it = find(from_ascii("ref")); @@ -593,8 +595,12 @@ docstring const & BibTeXInfo::getInfo(BibTeXInfo const * const xref, info_ = expandFormat(format, xref, counter, buf, docstring(), docstring(), docstring(), false); - if (!info_.empty()) - info_ = convertLaTeXCommands(info_); + if (!info_.empty()) { + info_richtext_ = convertLaTeXCommands(processRichtext(info_, true)); + info_ = convertLaTeXCommands(processRichtext(info_, false)); + if (richtext) + return info_richtext_; + } return info_; } diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h index 477f0a1..0f1b3d8 100644 --- a/src/BiblioInfo.h +++ b/src/BiblioInfo.h @@ -147,6 +147,8 @@ private: docstring entry_type_; /// a cache for getInfo() mutable docstring info_; + /// a cache for getInfo(richtext = true) + mutable docstring info_richtext_; /// docstring cite_number_; /// ----------------------------------------------------------------------- Summary of changes: src/BiblioInfo.cpp | 12 +++++++++--- src/BiblioInfo.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) hooks/post-receive -- The LyX Source Repository
