]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macrotable.C
fix pullArg when pressing <Delete> at the end of an cell
[lyx.git] / src / mathed / math_macrotable.C
index 00c853a4a0a240b700fba967d2f91d7b5c33042a..978766ab5be514833619ea5047d77fa827b3c17d 100644 (file)
 #include "math_macrotemplate.h"
 #include "math_parser.h"
 #include "array.h"
-#include "math_accentinset.h"
+#include "math_decorationinset.h"
 #include "math_deliminset.h"
 #include "math_fracinset.h"
 #include "math_inset.h"
 #include "debug.h"
 #include "support/LAssert.h"
 
-
-using namespace std;
-
+using std::endl;
 
 MathMacroTable::table_type MathMacroTable::macro_table;
 
 
 void MathMacroTable::dump()
 {
-       cerr << "\n------------------------------------------\n";
+       lyxerr << "\n------------------------------------------\n";
        table_type::const_iterator it;
        for (it = macro_table.begin(); it != macro_table.end(); ++it)
-               cerr << it->first << " [" << it->second->nargs() << "] : "
+               lyxerr << it->first << " [" << it->second->nargs() << "] : "
                        << it->second << endl;
-       cerr << "------------------------------------------\n";
+       lyxerr << "------------------------------------------" << endl;;
 }
 
 
@@ -42,7 +40,7 @@ void MathMacroTable::updateTemplate(MathMacroTemplate * par)
 
        if (pos == macro_table.end())
                lyxerr << "MathMacroTable::updateTemplate: no template with name '"
-                               << par->name() << "' available.\n";
+                      << par->name() << "' available." << endl;
        else
                pos->second = par;
 }
@@ -62,7 +60,7 @@ MathMacroTemplate & MathMacroTable::provideTemplate(string const & name)
 
        if (pos == macro_table.end()) {
                lyxerr << "MathMacroTable::provideTemplate: no template with name '"
-                               << name << "' available.\n";
+                      << name << "' available." << endl;
        }
                
        return *pos->second;
@@ -91,12 +89,14 @@ void MathMacroTable::builtinMacros()
 
        built = true;
     
-       lyxerr[Debug::MATHED] << "Building macros\n";
+       lyxerr[Debug::MATHED] << "Building macros" << endl;
     
        // This macro doesn't have arguments
        {
                MathMacroTemplate * t = new MathMacroTemplate("notin", 0);
-               t->push_back(new MathAccentInset(LM_in, LM_TC_BOPS, LM_not));
+               MathDecorationInset * p = new MathDecorationInset("not", LM_not);
+               p->cell(0).push_back(LM_in, LM_TC_BOPS);
+               t->push_back(p);
                insertTemplate(t);
        }
 
@@ -113,7 +113,27 @@ void MathMacroTable::builtinMacros()
 
        {
                MathMacroTemplate * t = new MathMacroTemplate("emptyset", 0);
-               t->push_back(new MathAccentInset('0', LM_TC_RM, LM_not));
+               MathDecorationInset * p = new MathDecorationInset("not", LM_not);
+               p->cell(0).push_back('O', LM_TC_VAR);
+               t->push_back(p);
+               insertTemplate(t);
+       }
+
+       {
+               MathMacroTemplate * t = new MathMacroTemplate("land", 0);
+               t->push_back(LM_wedge, LM_TC_SYMB);
+               insertTemplate(t);
+       }
+
+       {
+               MathMacroTemplate * t = new MathMacroTemplate("lor", 0);
+               t->push_back(LM_vee, LM_TC_SYMB);
+               insertTemplate(t);
+       }
+
+       {
+               MathMacroTemplate * t = new MathMacroTemplate("to", 0);
+               t->push_back(LM_rightarrow, LM_TC_SYMB);
                insertTemplate(t);
        }
 
@@ -122,6 +142,7 @@ void MathMacroTable::builtinMacros()
                t->push_back(LM_bot, LM_TC_BOP);
                insertTemplate(t);
        }
+
 /*
        {
                MathMacroTemplate & m = createTemplate("lint", 4);
@@ -143,7 +164,7 @@ void MathMacroTable::builtinMacros()
 
        // binom has two arguments
        {
-               MathFracInset * frac = new MathFracInset(LM_OT_ATOP);
+               MathFracInset * frac = new MathFracInset("atop");
                frac->cell(0).push_back(new MathMacroArgument(1));
                frac->cell(1).push_back(new MathMacroArgument(2));