]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathPhantom.cpp
g-brief loads babel internally. So don't load it ourselves.
[lyx.git] / src / mathed / InsetMathPhantom.cpp
index 9d6295bb060ccff99a56e3730571021b72b146b5..ed9cfd8cc903b270c4c0c4e3eefe4ad61fcec810 100644 (file)
 
 #include "LaTeXFeatures.h"
 #include "MathStream.h"
+
+#include "MetricsInfo.h"
+
 #include "frontends/Painter.h"
 
+#include <algorithm>
 #include <ostream>
 
 namespace lyx {
@@ -34,20 +38,21 @@ Inset * InsetMathPhantom::clone() const
 
 void InsetMathPhantom::metrics(MetricsInfo & mi, Dimension & dim) const
 {
+       Changer dummy = mi.base.changeEnsureMath();
        cell(0).metrics(mi, dim);
-       metricsMarkers(dim);
 }
 
 
 void InsetMathPhantom::draw(PainterInfo & pi, int x, int y) const
 {
+       Changer dummy = pi.base.changeEnsureMath();
        static int const arrow_size = 4;
 
        // We first draw the text and then an arrow
        ColorCode const origcol = pi.base.font.color();
        if (visibleContents())
                pi.base.font.setColor(Color_special);
-       cell(0).draw(pi, x + 1, y);
+       cell(0).draw(pi, x, y);
        if (visibleContents())
                pi.base.font.setColor(origcol);
        Dimension const dim = dimension(*pi.base.bv);
@@ -241,12 +246,10 @@ void InsetMathPhantom::draw(PainterInfo & pi, int x, int y) const
                else
                        pi.pain.line(x2, y1, x2, y5, Color_added_space);
        }
-
-       drawMarkers(pi, x, y);
 }
 
 
-void InsetMathPhantom::write(WriteStream & os) const
+void InsetMathPhantom::write(TeXMathStream & os) const
 {
        MathEnsurer ensurer(os);
        if (os.fragile())
@@ -375,8 +378,8 @@ void InsetMathPhantom::validate(LaTeXFeatures & features) const
 }
 
 
-bool InsetMathPhantom::visibleContents() const 
-{ 
+bool InsetMathPhantom::visibleContents() const
+{
        return kind_ == phantom || kind_ == vphantom || kind_ == hphantom;
 }