MathData::MathData(Buffer * buf, const_iterator from, const_iterator to)
: base_type(from, to), minasc_(0), mindes_(0), slevel_(0),
- sshift_(0), kerning_(0), buffer_(buf)
+ sshift_(0), buffer_(buf)
{}
MathRow mrow(mi, this);
mrow.metrics(mi, dim);
- kerning_ = mrow.kerning(bv);
// Set a minimal ascent/descent for the cell
if (tight)
MathData const & c1 = inset->cell(s1.idx());
if (s1.idx() == s2.idx() && &c1 == this) {
- // selection indide cell
+ // selection inside cell
Dimension const dim = bv->coordCache().getArrays().dim(&c1);
int const beg = c1.pos2x(bv, s1.pos());
int const end = c1.pos2x(bv, s2.pos());
}
-void MathData::updateBuffer(ParIterator const & it, UpdateType utype)
+int MathData::kerning(BufferView const * bv) const
+{
+ return bv->mathRow(this).kerning(bv);
+}
+
+
+void MathData::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
{
// pass down
for (size_t i = 0, n = size(); i != n; ++i) {
MathAtom & at = operator[](i);
- at.nucleus()->updateBuffer(it, utype);
+ at.nucleus()->updateBuffer(it, utype, deleted);
}
}
}
+MathClass MathData::lastMathClass() const
+{
+ MathClass res = MC_ORD;
+ for (MathAtom const & at : *this) {
+ MathClass mc = at->mathClass();
+ if (mc != MC_UNKNOWN)
+ return res = mc;
+ }
+ return res;
+}
+
+
ostream & operator<<(ostream & os, MathData const & ar)
{
odocstringstream oss;