#endif
#include "math_nestinset.h"
+#include "math_mathmlstream.h"
#include "debug.h"
}
-void MathNestInset::metrics(MathStyles st) const
+void MathNestInset::metrics(MathMetricsInfo const & mi) const
{
- size_ = st;
for (idx_type i = 0; i < nargs(); ++i)
- xcell(i).metrics(st);
+ xcell(i).metrics(mi);
}
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
{
- lyxerr << "---------------------------------------------\n";
- write(lyxerr, false);
- lyxerr << "\n";
+ WriteStream os(lyxerr);
+ os << "---------------------------------------------\n";
+ write(os);
+ os << "\n";
for (idx_type i = 0; i < nargs(); ++i)
- lyxerr << cell(i) << "\n";
- lyxerr << "---------------------------------------------\n";
+ os << cell(i) << "\n";
+ os << "---------------------------------------------\n";
}
-void MathNestInset::push_back(MathInset * p)
+void MathNestInset::validate(LaTeXFeatures & features) const
{
- if (nargs())
- cells_.back().data_.push_back(p);
- 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);
}