From c90b4fcb8723b6163bb205fc29df7a24c1d9449a Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 8 Jan 2010 18:19:37 +0000 Subject: [PATCH] Use calculated labels in XHTML output. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32892 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 2 +- src/insets/InsetCitation.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 9b8730d465..b3e0864c74 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1458,7 +1458,7 @@ void Buffer::writeLyXHTMLSource(odocstream & os, validate(features); updateLabels(UpdateMaster, true); checkBibInfoCache(); - d->bibinfo_.collectCitedEntries(*this); + d->bibinfo_.makeCitationLabels(*this); if (!only_body) { os << "\n"; diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp index 088b671ec3..6ba46a6546 100644 --- a/src/insets/InsetCitation.cpp +++ b/src/insets/InsetCitation.cpp @@ -533,10 +533,14 @@ docstring InsetCitation::xhtml(XHTMLStream & xs, OutputParams const &) const xs << ", "; first = false; } - docstring const & label = bibinfo.label(); - docstring const & target = label.empty() ? *it : label; + docstring citekey = bibinfo.citeKey(); + if (citekey.empty()) { + citekey = bibinfo.label(); + if (citekey.empty()) + citekey = *it; + } string const attr = "href='#" + to_utf8(*it) + "'"; - xs << StartTag("a", attr) << target << EndTag("a"); + xs << StartTag("a", attr) << citekey << EndTag("a"); } docstring const & after = getParam("after"); -- 2.39.2