]> git.lyx.org Git - features.git/commitdiff
Fix cache for getInfo() with/without richtext (fixes #8486).
authorJulien Rioux <jrioux@lyx.org>
Tue, 8 Jan 2013 15:24:11 +0000 (16:24 +0100)
committerJulien Rioux <jrioux@lyx.org>
Tue, 8 Jan 2013 15:24:37 +0000 (16:24 +0100)
src/BiblioInfo.cpp
src/BiblioInfo.h
status.20x

index 0df795e5068b0b889b539aca044b266c87f07abb..516d1b4670b555df9fa9caf7c39343ab9dacc7b6 100644 (file)
@@ -524,8 +524,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"));
@@ -536,10 +538,15 @@ docstring const & BibTeXInfo::getInfo(BibTeXInfo const * const xref,
        DocumentClass const & dc = buf.params().documentClass();
        string const & format = dc.getCiteFormat(to_utf8(entry_type_));
        int counter = 0;
-       info_ = expandFormat(format, xref, counter, buf, richtext);
+       info_ = expandFormat(format, xref, counter, buf, false);
+       info_richtext_ = expandFormat(format, xref, counter, buf, true);
 
        if (!info_.empty())
                info_ = convertLaTeXCommands(info_);
+       if (!info_richtext_.empty())
+               info_richtext_ = convertLaTeXCommands(info_richtext_);
+       if (richtext)
+               return info_richtext_;
        return info_;
 }
 
index efe4bff233948d61e5785959e87a0f2815bd320f..acfc0222dfae4a324e52a08a49039bbb345dc73c 100644 (file)
@@ -138,6 +138,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_;
        ///
index d612849bfd1e357e8ba4e521a9d2fc477b222024..db7e4ffc2b48d4f2a740f7898c6f43a22efb2703 100644 (file)
@@ -92,6 +92,8 @@ What's new
 - In order to avoid NFSS problems with certain font packages, load the needed
   font encodings when inserting cyrillic and/or greek characters (bug 8467).
 
+- Fix the output of LyXHTML bibliography with richtext (bug 8486).
+
 
 * USER INTERFACE