]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathXArrow.cpp
Do not throw exceptions here either. See r22806.
[lyx.git] / src / mathed / InsetMathXArrow.cpp
index 3faee295f3b10602d7590e3fd5f6dbb91a7cf631..54d73563817641a4580d5d899dfe06c99bd1c17a 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -23,8 +23,8 @@ using namespace std;
 namespace lyx {
 
 
-InsetMathXArrow::InsetMathXArrow(docstring const & name)
-       : InsetMathFracBase(), name_(name)
+InsetMathXArrow::InsetMathXArrow(Buffer * buf, docstring const & name)
+       : InsetMathFracBase(buf), name_(name)
 {}
 
 
@@ -62,6 +62,7 @@ void InsetMathXArrow::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathXArrow::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        os << '\\' << name_;
        if (cell(1).size())
                os << '[' << cell(1) << ']';
@@ -75,6 +76,16 @@ void InsetMathXArrow::normalize(NormalStream & os) const
 }
 
 
+void InsetMathXArrow::mathmlize(MathStream & ms) const
+{
+       char const * const arrow = name_ == "xleftarrow" 
+                       ? "&larr;" : "&rarr;";
+       ms << "<munderover accent='false' accentunder='false'>"
+          << arrow << cell(1) << cell(0)
+          << "</munderover>";
+}
+
+
 void InsetMathXArrow::validate(LaTeXFeatures & features) const
 {
        features.require("amsmath");