]> git.lyx.org Git - features.git/commitdiff
Revert rev18728, which is not a good idea
authorBo Peng <bpeng@lyx.org>
Sat, 9 Jun 2007 18:06:11 +0000 (18:06 +0000)
committerBo Peng <bpeng@lyx.org>
Sat, 9 Jun 2007 18:06:11 +0000 (18:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18729 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetListings.cpp
src/insets/InsetListingsParams.cpp
src/insets/InsetListingsParams.h

index 3c42f3bce5676ef7dd6da254190ccf4fcd5c85fc..cac92f8ce1d2a748ab92c2e69b4567aebec63799 100644 (file)
@@ -131,7 +131,7 @@ docstring const InsetListings::editMessage() const
 int InsetListings::latex(Buffer const & buf, odocstream & os,
                    OutputParams const & runparams) const
 {
-       string param_string = params().params(",", true);
+       string param_string = params().params();
        // NOTE: I use {} to quote text, which is an experimental feature
        // of the listings package (see page 25 of the manual)
        int lines = 0;
index 74b41c9df16c5e97a87957148fe773ffae031578..8e7aa2195cbcf69aae53ae2554d9eea7ba3067e5 100644 (file)
@@ -35,7 +35,6 @@ namespace lyx
 
 using support::bformat;
 using support::trim;
-using support::ltrim;
 using support::rtrim;
 using support::subst;
 using support::isStrInt;
@@ -124,7 +123,7 @@ docstring ListingsParam::validate(string const & par) const
        switch (type_) {
 
        case ALL:
-               if (par2.empty() && !onoff_ && hint_ != _("Bypass validation")) {
+               if (par2.empty() && !onoff_) {
                        if (!hint_.empty())
                                return hint_;
                        else
@@ -303,12 +302,6 @@ ParValidator::ParValidator()
 
        /// options copied from page 26 of listings manual
        // FIXME: add default parameters ... (which is not used now)
-
-       // special ListingsParam returned for parameters starting with @
-       // which helps them bypass validation.
-       all_params_["@"] =
-               ListingsParam("", false, ALL, "", _("Bypass validation"));
-
        all_params_["float"] =
                ListingsParam("false", true, SUBSETOF, "*tbph", empty_hint);
        all_params_["floatplacement"] =
@@ -628,10 +621,6 @@ ListingsParam const & ParValidator::param(string const & name) const
                                                from_utf8(suffix), from_utf8(param_names)));
        }
  
-       // do not validate keys starting with @
-       if (name[0] == '@')
-               return all_params_.find("@")->second;
-
        // locate name in parameter table
        ListingsParams::const_iterator it = all_params_.find(name);
        if (it != all_params_.end())
@@ -648,8 +637,7 @@ ListingsParam const & ParValidator::param(string const & name) const
                }
        }
        if (matching_names.empty())
-               throw invalidParam(bformat(_("Unknown listing parameter name: %1$s. "
-                       "Prefix this parameter with @ to bypass validation."),
+               throw invalidParam(bformat(_("Unknown listing parameter name: %1$s"),
                                                    from_utf8(name)));
        else
                throw invalidParam(bformat(_("Parameters starting with '%1$s': %2$s"),
@@ -696,7 +684,7 @@ void InsetListingsParams::read(Lexer & lex)
 }
 
 
-string InsetListingsParams::params(string const & sep, bool valid_key) const
+string InsetListingsParams::params(string const & sep) const
 {
        string par;
        for (map<string, string>::const_iterator it = params_.begin();
@@ -704,14 +692,10 @@ string InsetListingsParams::params(string const & sep, bool valid_key) const
                if (!par.empty())
                        par += sep;
                // key=value,key=value1 is stored in params_ as key=value,key_=value1. 
-               string key = rtrim(it->first, "_");
-               // remove prefix @ which is used by a parameter to bypass validation
-               if (valid_key)
-                       key = ltrim(key, "@");
                if (it->second.empty())
-                       par += key;
+                       par += rtrim(it->first, "_");
                else
-                       par += key + '=' + it->second;
+                       par += rtrim(it->first, "_") + '=' + it->second;
        }
        return par;
 }
index 6341bb994e35071a84a3125c52dfac70444415a9..341d73d507aa28b3e622e8e2e16a3a0f6a0649e8 100644 (file)
@@ -35,9 +35,7 @@ public:
        void read(Lexer &);
 
        /// valid parameter string
-       /// \param valid_key whether or not strip leading @, which is 
-       ///                  used to bypass validator
-       std::string params(std::string const & sep=",", bool valid_key=false) const;
+       std::string params(std::string const & sep=",") const;
 
        /// add key=value to params_
        void addParam(std::string const & key, std::string const & value);