]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MacroTable.cpp
Revert "Fix a number of signedness warnings"
[lyx.git] / src / mathed / MacroTable.cpp
index af974059494cafb9a0088d9716b3d2b8c1dc01d7..fb2a9e08a4fc7658984af5a0c54955db3323c1d1 100644 (file)
@@ -10,8 +10,9 @@
 
 #include <config.h>
 
-#include "InsetMathSqrt.h"
 #include "MacroTable.h"
+
+#include "InsetMathSqrt.h"
 #include "InsetMathMacroTemplate.h"
 #include "InsetMathMacroArgument.h"
 #include "MathParser.h"
@@ -20,7 +21,6 @@
 #include "InsetMathNest.h"
 
 #include "Buffer.h"
-#include "DocIterator.h"
 #include "InsetList.h"
 #include "Text.h"
 
@@ -63,7 +63,7 @@ MacroData::MacroData(Buffer * buf, InsetMathMacroTemplate const & macro)
 }
 
 
-bool MacroData::expand(vector<MathData> const & args, MathData & to) const
+bool MacroData::expand(vector<MathData> const & from, MathData & to) const
 {
        updateData();
 
@@ -82,9 +82,9 @@ bool MacroData::expand(vector<MathData> const & args, MathData & to) const
                //it.cell().erase(it.pos());
                //it.cell().insert(it.pos(), it.nextInset()->asInsetMath()
                size_t n = static_cast<InsetMathMacroArgument*>(it.nextInset())->number();
-               if (n <= args.size()) {
+               if (n <= from.size()) {
                        it.cell().erase(it.pos());
-                       it.cell().insert(it.pos(), args[n - 1]);
+                       it.cell().insert(it.pos(), from[n - 1]);
                }
        }
        //LYXERR0("MathData::expand: res: " << inset.cell(0));
@@ -126,6 +126,14 @@ bool MacroData::hidden() const
 }
 
 
+docstring const MacroData::htmlname() const
+{
+       if (sym_)
+               return sym_->htmlname;
+       return docstring();
+}
+
+
 docstring const MacroData::xmlname() const
 {
        if (sym_)
@@ -241,11 +249,11 @@ MacroTable::insert(docstring const & name, MacroData const & data)
 
 
 MacroTable::iterator
-MacroTable::insert(Buffer * buf, docstring const & def)
+MacroTable::insert(Buffer * buf, docstring const & definition)
 {
        //lyxerr << "MacroTable::insert, def: " << to_utf8(def) << endl;
        InsetMathMacroTemplate mac(buf);
-       mac.fromString(def);
+       mac.fromString(definition);
        MacroData data(buf, mac);
        return insert(mac.name(), data);
 }