]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBoldSymbol.cpp
Combine OutlineIn and OutlineOut blocks
[lyx.git] / src / mathed / InsetMathBoldSymbol.cpp
index f5bb350a01df4d788336f94824462f4d886d1479..465a7bf77a1469fec36aa611689dcb400fbbdfe9 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.
  */
@@ -21,8 +21,8 @@
 
 namespace lyx {
 
-InsetMathBoldSymbol::InsetMathBoldSymbol(Kind kind)
-       : InsetMathNest(1), kind_(kind)
+InsetMathBoldSymbol::InsetMathBoldSymbol(Buffer * buf, Kind kind)
+       : InsetMathNest(buf, 1), kind_(kind)
 {}
 
 
@@ -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");
@@ -76,6 +91,7 @@ void InsetMathBoldSymbol::validate(LaTeXFeatures & features) const
 
 void InsetMathBoldSymbol::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        switch (kind_) {
        case AMS_BOLD:
                os << "\\boldsymbol{" << cell(0) << "}";
@@ -90,6 +106,18 @@ void InsetMathBoldSymbol::write(WriteStream & os) const
 }
 
 
+void InsetMathBoldSymbol::mathmlize(MathStream & os) const
+{
+       os << "<mstyle mathvariant='bold'>" << cell(0) << "</mstyle>";
+}
+
+
+void InsetMathBoldSymbol::htmlize(HtmlStream & os) const
+{
+       os << MTag("b") << cell(0) << ETag("b");
+}
+
+
 void InsetMathBoldSymbol::infoize(odocstream & os) const
 {
        switch (kind_) {