Improve info display for biblatex databases, part III

When resolving biblatex's xdata references, consider that xdata fields
can contain a comma-separated list of keys, not just a single key like
crossref.
This commit is contained in:
Juergen Spitzmueller 2016-09-19 19:09:42 +02:00
parent d0f608d28e
commit 67da1431de

View File

@ -799,8 +799,13 @@ vector<docstring> const BiblioInfo::getXRefs(BibTeXInfo const & data, bool const
if (!nested && !data["crossref"].empty())
result.push_back(data["crossref"]);
// Biblatex's xdata field. Infinitely nestable.
docstring const xdatakey = data["xdata"];
if (!xdatakey.empty()) {
// XData field can consist of a comma-separated list of keys
vector<docstring> const xdatakeys = getVectorFromString(data["xdata"]);
if (!xdatakeys.empty()) {
vector<docstring>::const_iterator xit = xdatakeys.begin();
vector<docstring>::const_iterator xen = xdatakeys.end();
for (; xit != xen; ++xit) {
docstring const xdatakey = *xit;
result.push_back(xdatakey);
BiblioInfo::const_iterator it = find(xdatakey);
if (it != end()) {
@ -810,6 +815,7 @@ vector<docstring> const BiblioInfo::getXRefs(BibTeXInfo const & data, bool const
result.insert(result.end(), nxdata.begin(), nxdata.end());
}
}
}
return result;
}