From 5b2f5d056acdc9294c6e3cb069020f89d8bf2973 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Tue, 20 Sep 2016 11:34:17 +0200 Subject: [PATCH] Amend 2c4673af58f6 Also consider xrefs in crossref'ed entries. --- src/BiblioInfo.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp index a4a9323914..21c3b274cd 100644 --- a/src/BiblioInfo.cpp +++ b/src/BiblioInfo.cpp @@ -796,8 +796,18 @@ vector const BiblioInfo::getXRefs(BibTeXInfo const & data, bool const if (!data.isBibTeX()) return result; // Legacy crossref field. This is not nestable. - if (!nested && !data["crossref"].empty()) - result.push_back(data["crossref"]); + if (!nested && !data["crossref"].empty()) { + docstring const xrefkey = data["crossref"]; + result.push_back(xrefkey); + // However, check for nested xdatas + BiblioInfo::const_iterator it = find(xrefkey); + if (it != end()) { + BibTeXInfo const & xref = it->second; + vector const nxdata = getXRefs(xref, true); + if (!nxdata.empty()) + result.insert(result.end(), nxdata.begin(), nxdata.end()); + } + } // Biblatex's xdata field. Infinitely nestable. // XData field can consist of a comma-separated list of keys vector const xdatakeys = getVectorFromString(data["xdata"]);