]> git.lyx.org Git - features.git/blobdiff - src/mathed/math_macrotable.C
mathed67.diff
[features.git] / src / mathed / math_macrotable.C
index 8eeb66fe0e2785e7dec807c639fc8ce985827408..e4a41c05ccf882adcd635b40abfd3c429b80df58 100644 (file)
@@ -9,7 +9,6 @@
 #include "math_macrotable.h"
 #include "math_macro.h"
 #include "math_macrotemplate.h"
-#include "math_iter.h"
 #include "array.h"
 #include "math_accentinset.h"
 #include "math_deliminset.h"
@@ -85,9 +84,7 @@ void MathMacroTable::builtinMacros()
        // This macro doesn't have arguments
        {
                MathMacroTemplate & m = provideTemplate("notin", 0);
-               MathedIter iter(&m.GetData());
-               iter.insertInset(new MathAccentInset(LM_in, LM_TC_BOPS, LM_not),
-                                LM_TC_INSET);
+               m.push_back(new MathAccentInset(LM_in, LM_TC_BOPS, LM_not), LM_TC_INSET);
        }
 
        // This macro doesn't have arguments
@@ -99,18 +96,14 @@ void MathMacroTable::builtinMacros()
        mathed_parse(m.array, p, 0);
        }
 
-       // These two are only while we are still with LyX 2.x
        {
                MathMacroTemplate & m = provideTemplate("emptyset", 0);
-               MathedIter iter(&m.GetData());
-               iter.insertInset(new MathAccentInset('0', LM_TC_RM, LM_not),
-                                LM_TC_INSET);
+               m.push_back(new MathAccentInset('0', LM_TC_RM, LM_not), LM_TC_INSET);
        }
 
        {
                MathMacroTemplate & m = provideTemplate("perp", 0);
-               MathedIter iter(&m.GetData());
-               iter.insert(LM_bot, LM_TC_BOP);
+               m.GetData().push_back(LM_bot, LM_TC_BOP);
        }
 
        {
@@ -121,70 +114,16 @@ void MathMacroTable::builtinMacros()
        mathed_parse(m.array, p, 0);
        }
 
-       {
-               MathMacroTemplate & m = provideTemplate("binom", 2);
-               istringstream is("\\choose{#1}{#2}");
-               mathed_parser_file(is, 0);
-               MathParInset * p = &m;
-       mathed_parse(m.array, p, 0);
-       }
-
        // binom has two arguments
        {
-               MathMacroTemplate & m = provideTemplate("binom1", 2);
-               MathedIter iter(&m.GetData());
-
-               MathParInset * inset = new MathDelimInset('(', ')');
-               iter.insertInset(inset, LM_TC_ACTIVE_INSET);
-
-               MathedArray array2;
-               MathedIter iter2(&array2);
                MathFracInset * frac = new MathFracInset(LM_OT_ATOP);
-               iter2.insertInset(frac, LM_TC_ACTIVE_INSET);
-               frac->setData(array2);
-
-               MathedArray array3;
-               MathedIter iter3(&array3);
-               iter3.insertInset(new MathMacroArgument(1), LM_TC_INSET);
+               frac->push_back(new MathMacroArgument(1), LM_TC_INSET);
+               frac->denom()->push_back(new MathMacroArgument(2), LM_TC_INSET);
 
-               MathedArray array4;
-               MathedIter iter4(&array4);
-               iter4.insertInset(new MathMacroArgument(2), LM_TC_INSET);
-
-               frac->SetData(array3, array4);
-       }
-
-/*    
-       {
-               boost::shared_ptr<MathMacroTemplate> m(new MathMacroTemplate("perp", 0));
-               addTemplate(m);
-               MathedArray array;
-               MathedIter iter(&array);
-               iter.insert(LM_bot, LM_TC_BOP);
-               m->setData(array);
-       }
-
-       // binom has two arguments
-       {
-               boost::shared_ptr<MathMacroTemplate> m(new MathMacroTemplate("binom", 2));
-               addTemplate(m);
-               MathedArray array;
-               m->setData(array);
-               MathedIter iter(&array);
                MathParInset * inset = new MathDelimInset('(', ')');
-               iter.insertInset(inset, LM_TC_ACTIVE_INSET);
-               array = MathedArray();
-               MathedIter iter2(&array);
-               MathFracInset * frac = new MathFracInset(LM_OT_ATOP);
-               iter2.insertInset(frac, LM_TC_ACTIVE_INSET);
-               inset->setData(array);
-               array = MathedArray();
-               MathedArray array2;
-               MathedIter iter3(&array);
-               iter3.insertInset(m->getMacroPar(0), LM_TC_INSET);
-               MathedIter iter4(&array2);
-               iter4.insertInset(m->getMacroPar(1), LM_TC_INSET);
-               frac->SetData(array, array2);
+               inset->push_back(frac, LM_TC_ACTIVE_INSET);
+
+               MathMacroTemplate & m = provideTemplate("binom", 2);
+               m.push_back(inset, LM_TC_ACTIVE_INSET);
        }
-*/
 }