]> git.lyx.org Git - features.git/blobdiff - src/mathed/math_matrixinset.C
write \mathrm{x}\mathrm{y} as \mathrm{xy} again
[features.git] / src / mathed / math_matrixinset.C
index 9c289572c6fd45d6f4bf555d4261904f914ef1e3..4fa1ebd1f10c906d02d9809b933d45848cc59df9 100644 (file)
@@ -140,13 +140,13 @@ int MathMatrixInset::defaultColSpace(col_type col)
 }
 
 
-void MathMatrixInset::metrics(MathMetricsInfo const & st) const
+void MathMatrixInset::metrics(MathMetricsInfo const & mi) const
 {
-       size_ = st;
-       size_.style = (getType() == LM_OT_SIMPLE) ? LM_ST_TEXT : LM_ST_DISPLAY;
+       mi_ = mi;
+       mi_.style = (getType() == LM_OT_SIMPLE) ? LM_ST_TEXT : LM_ST_DISPLAY;
 
        // let the cells adjust themselves
-       MathGridInset::metrics(size_);
+       MathGridInset::metrics(mi_);
 
        if (display()) {
                ascent_  += 12;
@@ -156,7 +156,7 @@ void MathMatrixInset::metrics(MathMetricsInfo const & st) const
        if (numberedType()) {
                int l = 0;
                for (row_type row = 0; row < nrows(); ++row)
-                       l = std::max(l, mathed_string_width(LM_TC_BF, size_, nicelabel(row)));
+                       l = std::max(l, mathed_string_width(LM_TC_BF, mi_, nicelabel(row)));
 
                if (l)
                        width_ += 30 + l;
@@ -165,7 +165,7 @@ void MathMatrixInset::metrics(MathMetricsInfo const & st) const
        // make it at least as high as the current font
        int asc = 0;
        int des = 0;
-       math_font_max_dim(LM_TC_TEXTRM, size_, asc, des);
+       math_font_max_dim(LM_TC_TEXTRM, mi_, asc, des);
        ascent_  = std::max(ascent_,  asc);
        descent_ = std::max(descent_, des);
 }
@@ -173,16 +173,13 @@ void MathMatrixInset::metrics(MathMetricsInfo const & st) const
 
 void MathMatrixInset::draw(Painter & pain, int x, int y) const
 {
-       xo(x);
-       yo(y);
-
        MathGridInset::draw(pain, x, y);
 
        if (numberedType()) {
                int const xx = x + colinfo_.back().offset_ + colinfo_.back().width_ + 20;
                for (row_type row = 0; row < nrows(); ++row) {
                        int const yy = y + rowinfo_[row].offset_;
-                       drawStr(pain, LM_TC_BF, size_, xx, yy, nicelabel(row));
+                       drawStr(pain, LM_TC_BF, mi_, xx, yy, nicelabel(row));
                }
        }
 }
@@ -246,6 +243,14 @@ bool MathMatrixInset::numbered(row_type row) const
 bool MathMatrixInset::ams() const
 {
        return true;
+
+       return 
+               objtype_ == LM_OT_ALIGN ||
+               objtype_ == LM_OT_MULTLINE ||
+               objtype_ == LM_OT_GATHER ||
+               objtype_ == LM_OT_ALIGNAT ||
+               objtype_ == LM_OT_XALIGNAT ||
+               objtype_ == LM_OT_XXALIGNAT;
 }