]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathStackrel.cpp
Assure correct spacing of colored items in mathed
[lyx.git] / src / mathed / InsetMathStackrel.cpp
index 9a9c66f24c3671009f213dd9888268c329bde9f1..53e307571486e188ecbb4cac5e6f1291ffa7b43c 100644 (file)
@@ -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
@@ -124,9 +144,13 @@ void InsetMathStackrel::normalize(NormalStream & os) const
 void InsetMathStackrel::mathmlize(MathStream & ms) const
 {
        if (nargs() > 2)
-               ms << "<munderover>" << cell(0) << cell(2) << cell(1) << "</munderover>";
+               ms << "<" << from_ascii(ms.namespacedTag("munderover")) << ">"
+                  << cell(0) << cell(2) << cell(1)
+                  << "</" << from_ascii(ms.namespacedTag("munderover")) << ">";
        else
-               ms << "<mover accent='false'>" << cell(0) << cell(1) << "</mover>";
+               ms << "<" << from_ascii(ms.namespacedTag("mover")) << " accent='false'>"
+                  << cell(0) << cell(1)
+                  << "</" << from_ascii(ms.namespacedTag("mover")) << ">";
 }