]> git.lyx.org Git - features.git/commitdiff
Amend 2c4673af58f6
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 20 Sep 2016 09:34:17 +0000 (11:34 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 23 Oct 2016 06:12:34 +0000 (08:12 +0200)
Also consider xrefs in crossref'ed entries.

src/BiblioInfo.cpp

index a4a9323914eaa48ac20dedf25f8b135a18842344..21c3b274cd4d49969b2909b9b9329faf9c63ae9e 100644 (file)
@@ -796,8 +796,18 @@ vector<docstring> 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<docstring> 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<docstring> const xdatakeys = getVectorFromString(data["xdata"]);