}
docstring ret = operator[](key);
- if (ret.empty() && !xrefs.empty()) {
- // xr is a (reference to a) BibTeXInfo const *
- for (auto const & xr : xrefs) {
- if (xr && !(*xr)[key].empty()) {
- ret = (*xr)[key];
- break;
- }
- }
- }
if (ret.empty()) {
// some special keys
// FIXME: dialog, textbefore and textafter have nothing to do with this
ret = getYear();
}
+ // If we have no result, check in the cross-ref'ed entries
+ if (ret.empty() && !xrefs.empty()) {
+ // xr is a (reference to a) BibTeXInfo const *
+ for (auto const & xr : xrefs) {
+ if (!xr)
+ continue;
+ // use empty BibTeXInfoList to avoid loops
+ BibTeXInfoList xr_dummy;
+ ret = xr->getValueForKey(oldkey, buf, ci, xr_dummy, maxsize);
+ if (!ret.empty())
+ // success!
+ break;
+ }
+ }
+
if (cleanit)
ret = xml::cleanAttr(ret);