diff --git a/src/mathed/InsetMathOverset.cpp b/src/mathed/InsetMathOverset.cpp index 9d835f0d9e..3d36218d63 100644 --- a/src/mathed/InsetMathOverset.cpp +++ b/src/mathed/InsetMathOverset.cpp @@ -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); diff --git a/src/mathed/InsetMathOverset.h b/src/mathed/InsetMathOverset.h index eb6b86b798..213c96f5b3 100644 --- a/src/mathed/InsetMathOverset.h +++ b/src/mathed/InsetMathOverset.h @@ -30,6 +30,10 @@ public: /// bool idxUpDown(Cursor & cur, bool up) const; /// + bool idxFirst(Cursor &) const; + /// + bool idxLast(Cursor &) const; + /// void write(WriteStream & os) const; /// void normalize(NormalStream &) const; diff --git a/src/mathed/InsetMathStackrel.cpp b/src/mathed/InsetMathStackrel.cpp index 9a9c66f24c..430d8f1ad2 100644 --- a/src/mathed/InsetMathStackrel.cpp +++ b/src/mathed/InsetMathStackrel.cpp @@ -19,6 +19,8 @@ #include "LaTeXFeatures.h" #include "MetricsInfo.h" +#include "support/lassert.h" + using namespace std; namespace lyx { @@ -54,6 +56,24 @@ bool InsetMathStackrel::idxUpDown(Cursor & cur, bool up) const } +bool InsetMathStackrel::idxFirst(Cursor & cur) const +{ + LASSERT(&cur.inset() == this, return false); + cur.idx() = 0; + cur.pos() = 0; + return true; +} + + +bool InsetMathStackrel::idxLast(Cursor & cur) const +{ + LASSERT(&cur.inset() == this, return false); + cur.idx() = 0; + cur.pos() = cur.lastpos(); + return true; +} + + MathClass InsetMathStackrel::mathClass() const { // FIXME: update this when/if \stackbin is supported diff --git a/src/mathed/InsetMathStackrel.h b/src/mathed/InsetMathStackrel.h index d6ac815182..5740fb922b 100644 --- a/src/mathed/InsetMathStackrel.h +++ b/src/mathed/InsetMathStackrel.h @@ -24,6 +24,10 @@ public: /// bool idxUpDown(Cursor &, bool up) const; /// + bool idxFirst(Cursor &) const; + /// + bool idxLast(Cursor &) const; + /// MathClass mathClass() const; /// void metrics(MetricsInfo & mi, Dimension & dim) const; diff --git a/src/mathed/InsetMathUnderset.cpp b/src/mathed/InsetMathUnderset.cpp index 794427e2c2..832631dfa3 100644 --- a/src/mathed/InsetMathUnderset.cpp +++ b/src/mathed/InsetMathUnderset.cpp @@ -19,6 +19,7 @@ #include "LaTeXFeatures.h" #include "MetricsInfo.h" +#include "support/lassert.h" using namespace std; @@ -58,6 +59,24 @@ void InsetMathUnderset::draw(PainterInfo & pi, int x, int y) const } +bool InsetMathUnderset::idxFirst(Cursor & cur) const +{ + LASSERT(&cur.inset() == this, return false); + cur.idx() = 0; + cur.pos() = 0; + return true; +} + + +bool InsetMathUnderset::idxLast(Cursor & cur) const +{ + LASSERT(&cur.inset() == this, return false); + cur.idx() = 0; + cur.pos() = cur.lastpos(); + return true; +} + + void InsetMathUnderset::write(WriteStream & os) const { MathEnsurer ensurer(os); diff --git a/src/mathed/InsetMathUnderset.h b/src/mathed/InsetMathUnderset.h index fbc3e779de..50143ae4d5 100644 --- a/src/mathed/InsetMathUnderset.h +++ b/src/mathed/InsetMathUnderset.h @@ -28,6 +28,10 @@ public: /// void draw(PainterInfo & pi, int x, int y) const; /// + bool idxFirst(Cursor &) const; + /// + bool idxLast(Cursor &) const; + /// void write(WriteStream & ws) const; /// void normalize(NormalStream & ns) const;