]> git.lyx.org Git - features.git/blobdiff - src/mathed/MathData.cpp
Improved character count statistics for letter based insets (e.g. the LyX logo).
[features.git] / src / mathed / MathData.cpp
index a2b044cac0d712592e11b2caef472344e7a32fbb..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());
@@ -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;