]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathOverset.cpp
Fix assertion when checking if change in selection
[lyx.git] / src / mathed / InsetMathOverset.cpp
index b659a9eab4f2189dbf3c836a16deba1513e34239..3d36218d631eeabe09c99ea380aef70e4a5f4a35 100644 (file)
@@ -36,7 +36,7 @@ void InsetMathOverset::metrics(MetricsInfo & mi, Dimension & dim) const
        Changer dummy2 = mi.base.changeEnsureMath();
        Dimension dim0;
        cell(0).metrics(mi, dim0);
-       Changer dummy = mi.base.changeFrac();
+       Changer dummy = mi.base.changeScript();
        Dimension dim1;
        cell(1).metrics(mi, dim1);
        dim.wid = max(dim1.width(), dim0.wid) + 4;
@@ -54,7 +54,7 @@ void InsetMathOverset::draw(PainterInfo & pi, int x, int y) const
        int m  = x + dim.wid / 2;
        int yo = y - dim0.asc - dim1.des - 1;
        cell(0).draw(pi, m - dim0.wid / 2, y);
-       Changer dummy = pi.base.changeFrac();
+       Changer dummy = pi.base.changeScript();
        cell(1).draw(pi, m - dim1.width() / 2, yo);
 }
 
@@ -70,6 +70,24 @@ bool InsetMathOverset::idxUpDown(Cursor & cur, bool up) const
 }
 
 
+bool InsetMathOverset::idxFirst(Cursor & cur) const
+{
+       LASSERT(&cur.inset() == this, return false);
+       cur.idx() = 0;
+       cur.pos() = 0;
+       return true;
+}
+
+
+bool InsetMathOverset::idxLast(Cursor & cur) const
+{
+       LASSERT(&cur.inset() == this, return false);
+       cur.idx() = 0;
+       cur.pos() = cur.lastpos();
+       return true;
+}
+
+
 void InsetMathOverset::write(WriteStream & os) const
 {
        MathEnsurer ensurer(os);