Use calculated labels in XHTML output.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32892 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-01-08 18:19:37 +00:00
parent 2098f1d8c2
commit c90b4fcb87
2 changed files with 8 additions and 4 deletions

View File

@ -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 << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";

View File

@ -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");