]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathMacroTemplate.cpp
typo
[lyx.git] / src / mathed / InsetMathMacroTemplate.cpp
index e48d169ce0249f6bead756b16b7cdb202e216ce7..3525ba4e8c6f03d77c4ae31f00ca56907bc8f918 100644 (file)
@@ -22,7 +22,6 @@
 #include "MathStream.h"
 #include "MathParser.h"
 #include "MathSupport.h"
-#include "InsetMathMacroArgument.h"
 
 #include "Buffer.h"
 #include "BufferView.h"
@@ -217,13 +216,13 @@ Inset * InsetDisplayLabelBox::clone() const
 }
 
 
-InsetMath::marker_type InsetDisplayLabelBox::marker(BufferView const * bv) const
+marker_type InsetDisplayLabelBox::marker(BufferView const * bv) const
 {
        if (parent_.editing(bv)
            || !parent_.cell(parent_.displayIdx()).empty())
-               return MARKER;
+               return marker_type::MARKER;
        else
-               return NO_MARKER;
+               return marker_type::NO_MARKER;
 }
 
 
@@ -574,7 +573,7 @@ void InsetMathMacroTemplate::metrics(MetricsInfo & mi, Dimension & dim) const
        if (macro)
                macro->unlock();
 
-       dim.wid += leftOffset(mi.base.bv) + rightOffset(mi.base.bv);;
+       dim.wid += leftOffset(mi.base.bv) + rightOffset(mi.base.bv);
        dim.des += bottomOffset(mi.base.bv);
        dim.asc += topOffset(mi.base.bv);
 }
@@ -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;
@@ -1171,20 +1170,20 @@ void InsetMathMacroTemplate::write(ostream & os) const
 {
        odocstringstream oss;
        otexrowstream ots(oss);
-       WriteStream wi(ots, false, false, WriteStream::wsDefault);
+       TeXMathStream wi(ots, false, false, TeXMathStream::wsDefault);
        oss << "FormulaMacro\n";
        write(wi);
        os << to_utf8(oss.str());
 }
 
 
-void InsetMathMacroTemplate::write(WriteStream & os) const
+void InsetMathMacroTemplate::write(TeXMathStream & os) const
 {
        write(os, false);
 }
 
 
-int InsetMathMacroTemplate::write(WriteStream & os, bool overwriteRedefinition) const
+int InsetMathMacroTemplate::write(TeXMathStream & os, bool overwriteRedefinition) const
 {
        int num_lines = 0;
 
@@ -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;
                }
        }