#endif
#include "math_nestinset.h"
+#include "math_mathmlstream.h"
#include "debug.h"
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());
}
pos_type n = cell(idx).size();
if (pos == n)
return false;
-
pos = n;
return true;
}
void MathNestInset::dump() const
{
- MathWriteInfo os(lyxerr);
+ WriteStream os(lyxerr);
os << "---------------------------------------------\n";
write(os);
os << "\n";
}
-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);
}