]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathRoot.cpp
Fix bug 5802 (http://bugzilla.lyx.org/show_bug.cgi?id=5802)
[lyx.git] / src / mathed / InsetMathRoot.cpp
index d48eeece0e3beb40c1b7442aa639109376447a26..0a6759c2af1df5247b9af577c7576a03e0c4e47a 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.
  */
 #include "MathData.h"
 #include "MathStream.h"
 #include "Cursor.h"
-#include "Color.h"
 
 #include "frontends/Painter.h"
 
+using namespace std;
 
 namespace lyx {
 
@@ -36,7 +36,6 @@ Inset * InsetMathRoot::clone() const
 
 void InsetMathRoot::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       using std::max;
        InsetMathNest::metrics(mi);
        Dimension const & dim0 = cell(0).dimension(*mi.base.bv);
        Dimension const & dim1 = cell(1).dimension(*mi.base.bv);
@@ -44,8 +43,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);
 }
 
 
@@ -63,18 +60,19 @@ void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const
        int xp[4];
        int yp[4];
        pi.pain.line(x + dim.width(), y - a + 1,
-                                                        x + w + 4, y - a + 1, Color::math);
+                                                        x + w + 4, y - a + 1, Color_math);
        xp[0] = x + w + 4;         yp[0] = y - a + 1;
        xp[1] = x + w;             yp[1] = y + d;
        xp[2] = x + w - 2;         yp[2] = y + (d - a)/2 + 2;
        xp[3] = x + w - 5;         yp[3] = y + (d - a)/2 + 4;
-       pi.pain.lines(xp, yp, 4, Color::math);
+       pi.pain.lines(xp, yp, 4, Color_math);
        drawMarkers(pi, x, y);
 }
 
 
 void InsetMathRoot::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        os << "\\sqrt[" << cell(0) << "]{" << cell(1) << '}';
 }