]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathData.cpp
Assure correct spacing of colored items in mathed
[lyx.git] / src / mathed / MathData.cpp
index 9bfd558fe2856d8e1475648b8c9b1963255cf25a..90f41eb242c89dd9391e4b0cf97e169c103302e1 100644 (file)
@@ -322,7 +322,7 @@ void MathData::drawSelection(PainterInfo & pi, int const x, int const y) const
        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());
@@ -386,12 +386,12 @@ int MathData::kerning(BufferView const * bv) const
 }
 
 
-void MathData::updateBuffer(ParIterator const & it, UpdateType utype)
+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);
        }
 }
 
@@ -966,6 +966,18 @@ MathClass MathData::mathClass() const
 }
 
 
+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;