]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBoldSymbol.cpp
Improve the list of equations
[lyx.git] / src / mathed / InsetMathBoldSymbol.cpp
index b9a61b60f735231ce0c955f2c62d66cc8b253edd..d8205198843e821056080a0670a12f0097bf8038 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.
  */
@@ -14,6 +14,7 @@
 
 #include "MathStream.h"
 #include "MathData.h"
+#include "MetricsInfo.h"
 #include "LaTeXFeatures.h"
 
 #include <ostream>
@@ -21,8 +22,8 @@
 
 namespace lyx {
 
-InsetMathBoldSymbol::InsetMathBoldSymbol(Kind kind)
-       : InsetMathNest(1), kind_(kind)
+InsetMathBoldSymbol::InsetMathBoldSymbol(Buffer * buf, Kind kind)
+       : InsetMathNest(buf, 1), kind_(kind)
 {}
 
 
@@ -49,16 +50,18 @@ docstring InsetMathBoldSymbol::name() const
 
 void InsetMathBoldSymbol::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       //FontSetChanger dummy(mi.base, "mathbf");
+       Changer dummy = mi.base.changeEnsureMath();
+       //Changer dummy = mi.base.changeFontSet("mathbf");
        cell(0).metrics(mi, dim);
-       metricsMarkers(dim);
+       metricsMarkers(mi, dim);
        ++dim.wid;  // for 'double stroke'
 }
 
 
 void InsetMathBoldSymbol::draw(PainterInfo & pi, int x, int y) const
 {
-       //FontSetChanger dummy(pi.base, "mathbf");
+       Changer dummy = pi.base.changeEnsureMath();
+       //Changer dummy = pi.base.changeFontSet("mathbf");
        cell(0).draw(pi, x + 1, y);
        cell(0).draw(pi, x + 2, y);
        drawMarkers(pi, x, y);
@@ -106,6 +109,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_) {