]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathSymbol.cpp
Introduce a return value for mathmlize(). We will need this to be able
[features.git] / src / mathed / InsetMathSymbol.cpp
index 52d6eee85855ccb41e155d7f252fc1b69071660c..d09d40b02c901a21c92adf58ea48b5c1cfc4b947 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.
  */
@@ -175,23 +175,29 @@ void InsetMathSymbol::mathematica(MathematicaStream & os) const
 }
 
 
+// FIXME This will likely need some work.
 char const * MathMLtype(docstring const & s)
 {
-       if (s == "mathop")
-               return "mo";
-       return "mi";
+       if (s == "mathord")
+               return "mi";
+       return "mo";
 }
 
 
-void InsetMathSymbol::mathmlize(MathStream & os) const
+docstring InsetMathSymbol::mathmlize(MathStream & os) const
 {
+       // FIXME To get this working properly, we need to do add the 
+       // XML entity definitions to lib/symbols. And probably do more
+       // interesting things with MathMLtype
        char const * type = MathMLtype(sym_->extra);
        os << '<' << type << "> ";
-       if (sym_->xmlname == "x") // unknown so far
+       if (sym_->xmlname == "x") 
+               // unknown so far
                os << name();
        else
                os << sym_->xmlname;
        os << " </" << type << '>';
+       return docstring();
 }
 
 
@@ -206,6 +212,7 @@ void InsetMathSymbol::octave(OctaveStream & os) const
 
 void InsetMathSymbol::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        os << '\\' << name();
 
        // $,#, etc. In theory the restriction based on catcodes, but then