X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetCitation.cpp;h=e47f31189feddf44a1d922466ff7a3c663b60553;hb=eba2f0479eb5af6b61d9a82e89daea253d9b6bf6;hp=94a1592ee3c9abb579d9f4a0eed83c06b09668f7;hpb=23c231c761dda80d220927c15e15c14493a57bc2;p=lyx.git diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp index 94a1592ee3..e47f31189f 100644 --- a/src/insets/InsetCitation.cpp +++ b/src/insets/InsetCitation.cpp @@ -156,14 +156,16 @@ docstring InsetCitation::toolTip(BufferView const & bv, int, int) const if (key.empty()) return _("No citations selected!"); + CiteItem ci; + ci.richtext = true; vector keys = getVectorFromString(key); if (keys.size() == 1) - return bi.getInfo(keys[0], buffer(), true); + return bi.getInfo(keys[0], buffer(), ci); docstring tip; tip += "
    "; for (docstring const & key : keys) { - docstring const key_info = bi.getInfo(key, buffer(), true); + docstring const key_info = bi.getInfo(key, buffer(), ci); if (key_info.empty()) continue; tip += "
  1. " + key_info + "
  2. "; @@ -175,7 +177,6 @@ docstring InsetCitation::toolTip(BufferView const & bv, int, int) const namespace { - CitationStyle asValidLatexCommand(BufferParams const & bp, string const & input, vector const & valid_styles) { @@ -252,13 +253,12 @@ docstring InsetCitation::complexLabel(bool for_xhtml) const if (key.empty()) return _("No citations selected!"); - // We don't currently use the full or forceUCase fields. string cite_type = getCmdName(); - if (isUpperCase(cite_type[0])) - // If we were going to use them, this would mean ForceUCase + bool const uppercase = isUpperCase(cite_type[0]); + if (uppercase) cite_type[0] = lowercase(cite_type[0]); - if (cite_type[cite_type.size() - 1] == '*') - // and this would mean FULL + bool const starred = (cite_type[cite_type.size() - 1] == '*'); + if (starred) cite_type = cite_type.substr(0, cite_type.size() - 1); // handle alias @@ -266,9 +266,6 @@ docstring InsetCitation::complexLabel(bool for_xhtml) const if (!alias.empty()) cite_type = alias; - docstring const & before = getParam("before"); - docstring const & after = getParam("after"); - // FIXME: allow to add cite macros /* buffer().params().documentClass().addCiteMacro("!textbefore", to_utf8(before)); @@ -276,7 +273,18 @@ docstring InsetCitation::complexLabel(bool for_xhtml) const */ docstring label; vector keys = getVectorFromString(key); - label = biblist.getLabel(keys, buffer(), cite_type, for_xhtml, UINT_MAX, before, after); + CiteItem ci; + ci.textBefore = getParam("before"); + ci.textAfter = getParam("after"); + ci.forceUpperCase = uppercase; + ci.Starred = starred; + ci.max_size = UINT_MAX; + if (for_xhtml) { + ci.max_key_size = UINT_MAX; + ci.context = CiteItem::Export; + } + ci.richtext = for_xhtml; + label = biblist.getLabel(keys, buffer(), cite_type, ci); return label; }