]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_parser.C
Compile fix gcc 2.95 + stlport
[lyx.git] / src / mathed / math_parser.C
index a11f6fe75cb062a6bd5e9adab9e4fde61fa0b493..95a04811648f512cde99ca5c73546021c3db4e2b 100644 (file)
@@ -48,6 +48,7 @@ following hack as starting point to write some macros:
 #include "math_factory.h"
 #include "math_kerninset.h"
 #include "math_macro.h"
+#include "math_macroarg.h"
 #include "math_macrotemplate.h"
 #include "math_parboxinset.h"
 #include "math_parinset.h"
@@ -64,15 +65,18 @@ following hack as starting point to write some macros:
 #include "support/std_sstream.h"
 #include "debug.h"
 
+#ifndef CXX_GLOBAL_CSTD
+using std::atoi;
+#endif
+using std::endl;
+using std::fill;
 
+using std::string;
+using std::ios;
 using std::istream;
 using std::istringstream;
 using std::ostream;
-using std::ios;
-using std::endl;
-using std::fill;
 using std::vector;
-using std::atoi;
 
 
 //#define FILEDEBUG
@@ -720,7 +724,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        if (flags & FLAG_BRACE_LAST)
                                return;
                        error("found '}' unexpectedly");
-                       //lyx::Assert(0);
+                       //BOOST_ASSERT(false);
                        //add(cell, '}', LM_TC_TEX);
                }
 
@@ -1131,6 +1135,14 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                        return;
                }
 
+               else if (t.cs() == "color") {
+                       MathAtom at = createMathInset(t.cs());
+                       parse(at.nucleus()->cell(0), FLAG_ITEM, MathInset::TEXT_MODE);
+                       parse(at.nucleus()->cell(1), flags, mode);
+                       cell->push_back(at);
+                       return;
+               }
+
                else if (t.cs() == "substack") {
                        cell->push_back(createMathInset(t.cs()));
                        parse2(cell->back(), FLAG_ITEM, mode, false);
@@ -1153,7 +1165,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
 
                // Disabled
                else if (1 && t.cs() == "ar") {
-                       MathXYArrowInset * p = new MathXYArrowInset;
+                       auto_ptr<MathXYArrowInset> p(new MathXYArrowInset);
                        // try to read target
                        parse(p->cell(0), FLAG_OTPTION, mode);
                        // try to read label
@@ -1164,7 +1176,7 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
                                //lyxerr << "read label: " << p->cell(1) << endl;
                        }
 
-                       cell->push_back(MathAtom(p));
+                       cell->push_back(MathAtom(p.release()));
                        //lyxerr << "read cell: " << cell << endl;
                }
 #endif