]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathMacroTemplate.cpp
Revert "Fix a number of signedness warnings"
[lyx.git] / src / mathed / InsetMathMacroTemplate.cpp
index e48d169ce0249f6bead756b16b7cdb202e216ce7..1152936ee2e784f64b0ae7c49d654792bc3b78ba 100644 (file)
@@ -22,7 +22,6 @@
 #include "MathStream.h"
 #include "MathParser.h"
 #include "MathSupport.h"
-#include "InsetMathMacroArgument.h"
 
 #include "Buffer.h"
 #include "BufferView.h"
@@ -1088,7 +1087,7 @@ void InsetMathMacroTemplate::doDispatch(Cursor & cur, FuncRequest & cmd)
 
 
 bool InsetMathMacroTemplate::getStatus(Cursor & cur, FuncRequest const & cmd,
-       FuncStatus & flag) const
+       FuncStatus & status) const
 {
        bool ret = true;
        string const arg = to_utf8(cmd.argument());
@@ -1099,12 +1098,12 @@ bool InsetMathMacroTemplate::getStatus(Cursor & cur, FuncRequest const & cmd,
                                num = convert<int>(arg);
                        bool on = (num >= optionals_
                                   && numargs_ < 9 && num <= numargs_ + 1);
-                       flag.setEnabled(on);
+                       status.setEnabled(on);
                        break;
                }
 
                case LFUN_MATH_MACRO_APPEND_GREEDY_PARAM:
-                       flag.setEnabled(numargs_ < 9);
+                       status.setEnabled(numargs_ < 9);
                        break;
 
                case LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM:
@@ -1112,40 +1111,40 @@ bool InsetMathMacroTemplate::getStatus(Cursor & cur, FuncRequest const & cmd,
                        int num = numargs_;
                        if (!arg.empty())
                                num = convert<int>(arg);
-                       flag.setEnabled(num >= 1 && num <= numargs_);
+                       status.setEnabled(num >= 1 && num <= numargs_);
                        break;
                }
 
                case LFUN_MATH_MACRO_MAKE_OPTIONAL:
-                       flag.setEnabled(numargs_ > 0
+                       status.setEnabled(numargs_ > 0
                                     && optionals_ < numargs_
                                     && type_ != MacroTypeDef);
                        break;
 
                case LFUN_MATH_MACRO_MAKE_NONOPTIONAL:
-                       flag.setEnabled(optionals_ > 0
+                       status.setEnabled(optionals_ > 0
                                     && type_ != MacroTypeDef);
                        break;
 
                case LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM:
-                       flag.setEnabled(numargs_ < 9);
+                       status.setEnabled(numargs_ < 9);
                        break;
 
                case LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM:
-                       flag.setEnabled(optionals_ > 0);
+                       status.setEnabled(optionals_ > 0);
                        break;
 
                case LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM:
-                       flag.setEnabled(numargs_ == 0
+                       status.setEnabled(numargs_ == 0
                                     && type_ != MacroTypeDef);
                        break;
 
                case LFUN_IN_MATHMACROTEMPLATE:
-                       flag.setEnabled(true);
+                       status.setEnabled(true);
                        break;
 
                default:
-                       ret = InsetMathNest::getStatus(cur, cmd, flag);
+                       ret = InsetMathNest::getStatus(cur, cmd, status);
                        break;
        }
        return ret;
@@ -1293,10 +1292,10 @@ bool InsetMathMacroTemplate::validName() const
 
        // valid characters?
        if (n.size() > 1) {
-               for (size_t i = 0; i < n.size(); ++i) {
-                       if (!(n[i] >= 'a' && n[i] <= 'z')
-                           && !(n[i] >= 'A' && n[i] <= 'Z')
-                           && n[i] != '*')
+               for (char_type c : n) {
+                       if (!(c >= 'a' && c <= 'z')
+                           && !(c >= 'A' && c <= 'Z')
+                           && c != '*')
                                return false;
                }
        }