]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_matrixinset.C
fix pullArg when pressing <Delete> at the end of an cell
[lyx.git] / src / mathed / math_matrixinset.C
index bed9f943b1438bc1b43c9e84a377248e963f7037..d552e20242c35a77f4e4c3fce6a0f920abb728e7 100644 (file)
@@ -11,8 +11,6 @@
 #include "LaTeXFeatures.h"
 
 
-LyXFont WhichFont(short type, int size);
-
 namespace {
 
 string const getAlign(short int type, int cols)
@@ -98,9 +96,6 @@ void MathMatrixInset::Metrics(MathStyles /* st */, int, int)
 {
        size_ = (GetType() == LM_OT_SIMPLE) ? LM_ST_TEXT : LM_ST_DISPLAY;
 
-       //LyXFont wfont = WhichFont(LM_TC_BF, size());
-       //wfont.setLatex(LyXFont::OFF);
-
        // let the cells adjust themselves
        MathGridInset::Metrics(size_);
 
@@ -112,7 +107,7 @@ void MathMatrixInset::Metrics(MathStyles /* st */, int, int)
        if (numberedType()) {
                int l = 0;
                for (int row = 0; row < nrows(); ++row)
-                       l = std::max(l, mathed_string_width(LM_TC_TEXTRM, size(), nicelabel(row)));
+                       l = std::max(l, mathed_string_width(LM_TC_BF, size(), nicelabel(row)));
 
                if (l)
                        width_ += 30 + l;
@@ -128,13 +123,11 @@ void MathMatrixInset::draw(Painter & pain, int x, int y)
        MathGridInset::draw(pain, x, y);
 
        if (numberedType()) {
-               LyXFont wfont = WhichFont(LM_TC_BF, size());
-#ifndef NO_LATEX
-               wfont.setLatex(LyXFont::OFF);
-#endif
                int xx = x + colinfo_.back().offset_ + colinfo_.back().width_ + 20;
-               for (int row = 0; row < nrows(); ++row) 
-                       pain.text(xx, y + rowinfo_[row].offset_, nicelabel(row), wfont);
+               for (int row = 0; row < nrows(); ++row) {
+                       int yy = y + rowinfo_[row].offset_;
+                       drawStr(pain, LM_TC_BF, size(), xx, yy, nicelabel(row));
+               }
        }
 }
 
@@ -221,7 +214,7 @@ bool MathMatrixInset::numberedType() const
 }
 
 
-void MathMatrixInset::Validate(LaTeXFeatures & features)
+void MathMatrixInset::Validate(LaTeXFeatures & features) const
 {
        features.amsstyle = ams();
 
@@ -230,40 +223,11 @@ void MathMatrixInset::Validate(LaTeXFeatures & features)
        //if (features.amsstyle)
        //  return;
 
-       //Validate1(features);
-
        features.boldsymbol = true;
-       features.binom      = true;
-}
+       //features.binom      = true;
 
-/*
-void MathMatrixInset::Validate1(LaTeXFeatures & features)
-{
-       MathIter it(cell());
-
-       while (it.OK() && !(features.binom && features.boldsymbol)) {
-               MathInset * p = it.nextInset();
-               if (p) {
-                       p = it.GetActiveInset();
-                       if (p) {
-                               if (!features.binom && p->GetType() == LM_OT_MACRO &&
-                                   p->name() == "binom") {
-                                       features.binom = true;
-                               } else {
-                                       for (int i = 0; i <= p->getMaxArgumentIdx(); ++i) {
-                                               p->setArgumentIdx(i);
-                                               Validate1(features, p);
-                                       }
-                               }
-                       } else {
-                               if (!features.boldsymbol && p->name() == "boldsymbol") 
-                                       features.boldsymbol = true;
-                       }
-               }
-               it.Next();
-       }
+       MathInset::Validate(features);
 }
-*/
 
 
 void MathMatrixInset::header_write(std::ostream & os) const
@@ -454,7 +418,7 @@ void MathMatrixInset::mutate(short newtype)
        switch (GetType()) {
                case LM_OT_SIMPLE:
                        SetType(LM_OT_EQUATION);
-                       numbered(false);
+                       numbered(0, false);
                        mutate(newtype);
                        break;