X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathStackrel.cpp;h=5c0c2dcd4b0238999a2464b88902f5f1ee8f722c;hb=d9082639080b9de993742bd352f92e5183058cf5;hp=9a9c66f24c3671009f213dd9888268c329bde9f1;hpb=9c3bbeefab84f91422c6be98ca0664a33682e6de;p=lyx.git
diff --git a/src/mathed/InsetMathStackrel.cpp b/src/mathed/InsetMathStackrel.cpp
index 9a9c66f24c..5c0c2dcd4b 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
@@ -102,7 +122,7 @@ void InsetMathStackrel::draw(PainterInfo & pi, int x, int y) const
}
-void InsetMathStackrel::write(WriteStream & os) const
+void InsetMathStackrel::write(TeXMathStream & os) const
{
MathEnsurer ensurer(os);
os << "\\stackrel";
@@ -121,12 +141,16 @@ void InsetMathStackrel::normalize(NormalStream & os) const
}
-void InsetMathStackrel::mathmlize(MathStream & ms) const
+void InsetMathStackrel::mathmlize(MathMLStream & ms) const
{
if (nargs() > 2)
- ms << "" << cell(0) << cell(2) << cell(1) << "";
+ ms << "<" << from_ascii(ms.namespacedTag("munderover")) << ">"
+ << cell(0) << cell(2) << cell(1)
+ << "" << from_ascii(ms.namespacedTag("munderover")) << ">";
else
- ms << "" << cell(0) << cell(1) << "";
+ ms << "<" << from_ascii(ms.namespacedTag("mover")) << " accent='false'>"
+ << cell(0) << cell(1)
+ << "" << from_ascii(ms.namespacedTag("mover")) << ">";
}