]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathXYMatrix.cpp
Revert part of 503c7c16: InsetMathNest:edit resets anchor.
[features.git] / src / mathed / InsetMathXYMatrix.cpp
index 743c07ebd3fb2a0ea205e0a43c6a100fe9e21c84..d8f54602b9d3b20b106e9b91f687d0e070f6a5bf 100644 (file)
@@ -49,24 +49,25 @@ int InsetMathXYMatrix::rowsep() const
 
 void InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       FontInfo & f = mi.base.font;
-       Changer dummy = f.changeStyle(LM_ST_TEXT, f.style() == LM_ST_DISPLAY);
+       Changer dummy2 = mi.base.changeEnsureMath();
+       Changer dummy = mi.base.changeArray();
        InsetMathGrid::metrics(mi, dim);
 }
 
 
 void InsetMathXYMatrix::draw(PainterInfo & pi, int x, int y) const
 {
-       setPosCache(pi, x, y);
-       FontInfo & f = pi.base.font;
-       Changer dummy = f.changeStyle(LM_ST_TEXT, f.style() == LM_ST_DISPLAY);
+       Changer dummy2 = pi.base.changeEnsureMath();
+       Changer dummy = pi.base.changeArray();
        InsetMathGrid::draw(pi, x, y);
 }
 
 
-void InsetMathXYMatrix::write(WriteStream & os) const
+void InsetMathXYMatrix::write(TeXMathStream & os) const
 {
        MathEnsurer ensurer(os);
+       if (os.fragile())
+               os << "\\protect";
        os << "\\xymatrix";
        bool open = os.startOuterRow();
        if (equal_spacing_) {
@@ -155,15 +156,15 @@ void InsetMathXYMatrix::validate(LaTeXFeatures & features) const
 }
 
 
-void InsetMathXYMatrix::mathmlize(MathStream &) const
+void InsetMathXYMatrix::mathmlize(MathMLStream &) const
 {
        throw MathExportException();
 }
 
 
-void InsetMathXYMatrix::htmlize(HtmlStream &) const 
+void InsetMathXYMatrix::htmlize(HtmlStream &) const
 {
-       throw MathExportException(); 
+       throw MathExportException();
 }