]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_nestinset.C
make \newcommand{\bb}[1]{\mathbf{#1}} work for read/write/display.
[lyx.git] / src / mathed / math_nestinset.C
index ac8150043a3560d137f76ad34a82dde0a0aafde6..6113621b43f1b8e583467055f433d5dc562c5775 100644 (file)
@@ -3,6 +3,7 @@
 #endif
 
 #include "math_nestinset.h"
+#include "math_mathmlstream.h"
 #include "debug.h"
 
 
@@ -57,8 +58,6 @@ void MathNestInset::metrics(MathMetricsInfo const & mi) const
 
 void MathNestInset::draw(Painter & pain, int x, int y) const
 {
-       xo(x);
-       yo(y);
        for (idx_type i = 0; i < nargs(); ++i)
                xcell(i).draw(pain, x + xcell(i).xo(), y + xcell(i).yo());
 }
@@ -137,7 +136,7 @@ bool MathNestInset::idxEnd(idx_type & idx, pos_type & pos) const
 
 void MathNestInset::dump() const
 {
-       MathWriteInfo os(lyxerr);
+       WriteStream os(lyxerr);
        os << "---------------------------------------------\n";
        write(os);
        os << "\n";
@@ -147,17 +146,26 @@ void MathNestInset::dump() const
 }
 
 
-void MathNestInset::push_back(MathAtom const & t)
+void MathNestInset::validate(LaTeXFeatures & features) const
 {
-       if (nargs())
-               cells_.back().data_.push_back(t);
-       else
-               lyxerr << "can't push without a cell\n";
+       for (idx_type i = 0; i < nargs(); ++i)
+               cell(i).validate(features);
 }
 
 
-void MathNestInset::validate(LaTeXFeatures & features) const
+bool MathNestInset::match(MathInset * p) const
 {
+       if (nargs() != p->nargs())
+               return false;
        for (idx_type i = 0; i < nargs(); ++i)
-               cell(i).validate(features);
+               if (!cell(i).match(p->cell(i)))
+                       return false;
+       return true;
+}
+
+
+void MathNestInset::replace(ReplaceData & rep)
+{
+       for (idx_type i = 0; i < nargs(); ++i)
+               cell(i).replace(rep);
 }