]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathSpace.cpp
Introduce a return value for mathmlize(). We will need this to be able
[features.git] / src / mathed / InsetMathSpace.cpp
index 00435ddc792ea69baa7f4c3d61c1a677f6e82a35..b2a321234df7366418156ade3ebf5af2004b3f90 100644 (file)
@@ -192,6 +192,28 @@ void InsetMathSpace::octave(OctaveStream & os) const
 }
 
 
+docstring InsetMathSpace::mathmlize(MathStream & ms) const
+{
+       SpaceInfo const & si = space_info[space_];
+       if (si.negative || !si.visible)
+               return docstring();
+       string l;
+       if (si.custom)
+               l = length_.asHTMLString();
+       else if (si.kind != InsetSpaceParams::MEDIUM) {
+               stringstream ss;
+               ss << si.width;
+               l = ss.str() + "px";
+       }
+       
+       ms << "<mspace";
+       if (!l.empty())
+               ms << " width=\"" << from_ascii(l) << "\"";
+       ms << " />";
+       return docstring();
+}
+
+       
 void InsetMathSpace::normalize(NormalStream & os) const
 {
        os << "[space " << int(space_) << "] ";