]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBoldSymbol.cpp
A little cleanup of the layout files.
[lyx.git] / src / mathed / InsetMathBoldSymbol.cpp
index 7a7e5ece76c4568fa1507353189f7c84baa7ba8b..e53ff6c6cd5fdaec92bd8c42ddf7a22dcc95b9fc 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -32,6 +32,21 @@ Inset * InsetMathBoldSymbol::clone() const
 }
 
 
+docstring InsetMathBoldSymbol::name() const
+{
+       switch (kind_) {
+       case AMS_BOLD:
+               return from_ascii("boldsymbol");
+       case BM_BOLD:
+               return from_ascii("bm");
+       case BM_HEAVY:
+               return from_ascii("hm");
+       }
+       // avoid compiler warning
+       return docstring();
+}
+
+
 void InsetMathBoldSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        //FontSetChanger dummy(mi.base, "mathbf");
@@ -67,18 +82,25 @@ void InsetMathBoldSymbol::drawT(TextPainter & pain, int x, int y) const
 void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const
 {
        InsetMathNest::validate(features);
-       features.require("bm");
+       if (kind_ == AMS_BOLD)
+               features.require("amsbsy");
+       else
+               features.require("bm");
 }
 
 
 void InsetMathBoldSymbol::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        switch (kind_) {
-       case BOLD:
+       case AMS_BOLD:
                os << "\\boldsymbol{" << cell(0) << "}";
                break;
-       case HEAVY:
-               os << "\\heavysymbol{" << cell(0) << "}";
+       case BM_BOLD:
+               os << "\\bm{" << cell(0) << "}";
+               break;
+       case BM_HEAVY:
+               os << "\\hm{" << cell(0) << "}";
                break;
        }
 }
@@ -87,11 +109,14 @@ void InsetMathBoldSymbol::write(WriteStream & os) const
 void InsetMathBoldSymbol::infoize(odocstream & os) const
 {
        switch (kind_) {
-       case BOLD:
+       case AMS_BOLD:
                os << "Boldsymbol ";
                break;
-       case HEAVY:
-               os << "Heavysymbol ";
+       case BM_BOLD:
+               os << "Boldsymbol (bm)";
+               break;
+       case BM_HEAVY:
+               os << "Heavysymbol (bm)";
                break;
        }
 }