#include "math_inset.h"
#include "LString.h"
-class MathInset;
-class MathAtom;
-class MathGridInset;
-class MathFuncInset;
-class MathHullInset;
-class MathScriptInset;
-class MathSpaceInset;
class InsetFormulaBase;
-class MathArray;
-class MathXArray;
class Painter;
class Selection;
-class latexkeys;
/// Description of a position
struct MathCursorPos {
{
return bf_.end();
}
+
+
+bool MathArray::match(MathArray const & ar) const
+{
+ if (size() != ar.size())
+ return false;
+ for (const_iterator it = begin(), jt = ar.begin(); it != end(); ++it, ++jt)
+ if (!it->nucleus()->match(jt->nucleus()))
+ return false;
+ return true;
+}
#include <vector>
#include "math_atom.h"
-#include "LString.h"
-class MathScriptInset;
class MathMacro;
class LaTeXFeatures;
void dump2() const;
///
void substitute(MathMacro const &);
+ ///
+ bool match(MathArray const &) const;
///
MathAtom & at(size_type pos);
virtual void validate(LaTeXFeatures & features) const;
///
virtual void handleFont(MathTextCodes) {}
+ ///
+ virtual bool match(MathInset *) const { return false; }
/// write normalized content
virtual void normalize(NormalStream &) const;
}
return x >= x0 && x <= x1 && y >= y0 && y <= y1;
}
+
+
+bool MathNestInset::match(MathInset * p) const
+{
+ if (nargs() != p->nargs())
+ return false;
+ for (idx_type i = 0; i < nargs(); ++i)
+ if (!cell(i).match(p->cell(i)))
+ return false;
+ return true;
+}
void push_back(MathAtom const &);
///
void dump() const;
+ ///
+ bool match(MathInset *) const;
///
void validate(LaTeXFeatures & features) const;