]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetListingsParams.cpp
Regenerate previews after zoom (#11919)
[features.git] / src / insets / InsetListingsParams.cpp
index 06c05cbffe3d2b736c545ddff7702904263e2ad5..9390d6bbe4549867005cfe5e2ed3b2c8add7cecf 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "InsetListingsParams.h"
 
-#include "Length.h"
+#include "support/Length.h"
 #include "Lexer.h"
 
 #include "support/convert.h"
@@ -55,7 +55,7 @@ public:
                string const & i, docstring const & h)
                : value_(v), onoff_(o), type_(t), info_(i), hint_(h)
        {}
-       /// Validate a paramater.
+       /// Validate a parameter.
        /// \retval an empty string if \c par is valid.
        /// \retval otherwise an explanation WRT to \c par invalidity.
        docstring validate(string const & par) const;
@@ -232,8 +232,8 @@ docstring ListingsParam::validate(string const & par) const
                                return bformat(_("Please specify one or more of '%1$s'."),
                                                           from_utf8(info_));
                }
-               for (size_t i = 0; i < par2.size(); ++i)
-                       if (info_.find(par2[i], 0) == string::npos)
+               for (char c : par2)
+                       if (info_.find(c, 0) == string::npos)
                                return bformat(_("Should be composed of one or more of %1$s."),
                                                from_utf8(info_));
                if (unclosed)
@@ -948,12 +948,12 @@ docstring ParValidator::validate(string const & name,
 }
 
 
-bool ParValidator::onoff(string const & name) const
+bool ParValidator::onoff(string const & key) const
 {
        int p = InsetListingsParams::package();
 
        // locate name in parameter table
-       ListingsParams::const_iterator it = all_params_[p].find(name);
+       ListingsParams::const_iterator it = all_params_[p].find(key);
        if (it != all_params_[p].end())
                return it->second.onoff_;
        else
@@ -1073,8 +1073,8 @@ void InsetListingsParams::addParam(string const & key,
        // non-ascii/number characters, just to be safe
        else {
                bool has_special_char = false;
-               for (size_t i = 0; i < value.size(); ++i)
-                       if (!isAlnumASCII(value[i])) {
+               for (char c : value)
+                       if (!isAlnumASCII(c)) {
                                has_special_char = true;
                                break;
                        }