]> git.lyx.org Git - features.git/commitdiff
Make InsetCitation's params work like other classes.
authorRichard Heck <rgheck@lyx.org>
Thu, 22 Feb 2018 06:00:18 +0000 (01:00 -0500)
committerRichard Heck <rgheck@lyx.org>
Thu, 22 Feb 2018 06:02:02 +0000 (01:02 -0500)
src/insets/InsetCitation.cpp
src/insets/InsetCitation.h

index 3d18456f42a00642a77dbd192c1ad1e1650fc907..e52e87a6b79e4c467940873ff158b04460246af2 100644 (file)
@@ -42,9 +42,6 @@ using namespace lyx::support;
 
 namespace lyx {
 
-ParamInfo InsetCitation::param_info_;
-
-
 InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
        : InsetCommand(buf, p)
 {
@@ -64,6 +61,8 @@ InsetCitation::~InsetCitation()
 
 ParamInfo const & InsetCitation::findInfo(string const & /* cmdName */)
 {
+       static ParamInfo param_info_;
+
        // standard cite does only take one argument, but biblatex, jurabib
        // and natbib extend this to two arguments, so
        // we have to allow both here. InsetCitation takes care that
@@ -579,10 +578,11 @@ void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const
        if (qualified)
                os << "s";
 
+       ParamInfo const & pinfo = findInfo(string());
        docstring before = params().prepareCommand(runparams, getParam("before"),
-                                                  param_info_["before"].handling());
+                                                  pinfo["before"].handling());
        docstring after = params().prepareCommand(runparams, getParam("after"),
-                                                  param_info_["after"].handling());
+                                                  pinfo["after"].handling());
        if (!before.empty() && cs.textBefore) {
                if (qualified)
                        os << '(' << protectArgument(before, '(', ')')
@@ -606,9 +606,9 @@ void InsetCitation::latex(otexstream & os, OutputParams const & runparams) const
                        map<docstring, docstring> posts = getQualifiedLists(getParam("posttextlist"));
                        for (docstring const & k: keys) {
                                docstring bef = params().prepareCommand(runparams, pres[k],
-                                                                       param_info_["pretextlist"].handling());
-                               docstring aft  = params().prepareCommand(runparams, posts[k],
-                                                                        param_info_["posttextlist"].handling());
+                                                  pinfo["pretextlist"].handling());
+                               docstring aft = params().prepareCommand(runparams, posts[k],
+                                                  pinfo["posttextlist"].handling());
                                if (!bef.empty())
                                        os << '[' << protectArgument(bef)
                                           << "][" << protectArgument(aft) << ']';
index 3e5e3baa35a4cec485b0aa585659b3a7993382aa..2974ad44ead399a29cab75458f93ef83ebdd1490 100644 (file)
@@ -109,10 +109,6 @@ private:
        docstring screenLabel() const;
        //@}
 
-       /// we'll eventually want to be able to get info on this from the
-       /// various CiteEngines
-       static ParamInfo param_info_;
-
        ///
        struct Cache {
                Cache() : recalculate(true) {}