]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathRoot.cpp
Introduce a return value for mathmlize(). We will need this to be able
[features.git] / src / mathed / InsetMathRoot.cpp
index 0017e1c9542e38111970fac0ce880dd1d6b9e97a..7ca7706ba0dfbadda57adea73824bd909404e2f4 100644 (file)
@@ -4,7 +4,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Alejandro Aguilar Sierra
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -13,6 +13,7 @@
 
 #include "InsetMathRoot.h"
 #include "MathData.h"
+#include "MathExtern.h"
 #include "MathStream.h"
 #include "Cursor.h"
 
@@ -23,8 +24,8 @@ using namespace std;
 namespace lyx {
 
 
-InsetMathRoot::InsetMathRoot()
-       : InsetMathNest(2)
+InsetMathRoot::InsetMathRoot(Buffer * buf)
+       : InsetMathNest(buf, 2)
 {}
 
 
@@ -43,8 +44,6 @@ void InsetMathRoot::metrics(MetricsInfo & mi, Dimension & dim) const
        dim.des = max(dim0.descent() - 5, dim1.descent()) + 2;
        dim.wid = dim0.width() + dim1.width() + 10;
        metricsMarkers(dim);
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
 }
 
 
@@ -74,6 +73,7 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathRoot::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        os << "\\sqrt[" << cell(0) << "]{" << cell(1) << '}';
 }
 
@@ -113,9 +113,13 @@ void InsetMathRoot::octave(OctaveStream & os) const
 }
 
 
-void InsetMathRoot::mathmlize(MathStream & os) const
+docstring InsetMathRoot::mathmlize(MathStream & os) const
 {
-       os << MTag("mroot") << cell(1) << cell(0) << ETag("mroot");
+       os << MTag("mroot");
+       docstring rv = lyx::mathmlize(cell(1), os);
+       rv += lyx::mathmlize(cell(0), os);
+       os << ETag("mroot");
+       return rv;
 }