- InsetCommandMailer mailer("citation", *this);
- mailer.hideDialog();
-}
-
-
-string const InsetCitation::generateLabel(Buffer const & buffer) const
-{
- string const before = string();
- string const after = getOptions();
-
- string label;
- if (buffer.params().use_natbib) {
- string cmd = getCmdName();
- if (cmd == "cite") {
- // We may be "upgrading" from an older LyX version.
- // If, however, we use "cite" because the necessary
- // author/year info is not present in the biblio
- // database, then getNatbibLabel will exit gracefully
- // and we'll call getBasicLabel.
- if (buffer.params().use_numerical_citations)
- cmd = "citep";
- else
- cmd = "citet";
- }
- label = getNatbibLabel(buffer, cmd, getContents(),
- before, after,
- buffer.params().use_numerical_citations);
+ docstring const before = getParam("before");
+ docstring const after = getParam("after");
+
+ docstring label;
+ biblio::CiteEngine const engine = buffer.params().cite_engine;
+ if (engine != biblio::ENGINE_BASIC) {
+ // FIXME UNICODE
+ label = getNatbibLabel(buffer, getCmdName(), to_utf8(getParam("key")),
+ before, after, engine);