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 0f21c5caf6
commit 95f7545823

View File

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