]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathEnsureMath.cpp
add busy.gif to resources (in line with cmake)
[lyx.git] / src / mathed / InsetMathEnsureMath.cpp
index 81806673665b32ef86e6d31fba3b4c883812fc9a..3fdb3fbba9beeff3cacae91ca710a0b9d05c284a 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
  * \author Enrico Forestieri
  *
  * Full author contact details are available in file CREDITS.
 
 #include "InsetMathEnsureMath.h"
 
-#include "MathStream.h"
 #include "MathData.h"
+#include "MathStream.h"
+#include "MathSupport.h"
 
 #include <ostream>
 
 
 namespace lyx {
 
-InsetMathEnsureMath::InsetMathEnsureMath()
-       : InsetMathNest(1)
+InsetMathEnsureMath::InsetMathEnsureMath(Buffer * buf)
+       : InsetMathNest(buf, 1)
 {}
 
 
@@ -34,7 +35,8 @@ Inset * InsetMathEnsureMath::clone() const
 
 void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       FontSetChanger dummy(mi.base, "mathnormal");
+       bool really_change_font = isTextFont(from_ascii(mi.base.fontname));
+       FontSetChanger dummy(mi.base, "mathnormal", really_change_font);
        cell(0).metrics(mi, dim);
        metricsMarkers(dim);
 }
@@ -42,7 +44,8 @@ void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const
 
 void InsetMathEnsureMath::draw(PainterInfo & pi, int x, int y) const
 {
-       FontSetChanger dummy(pi.base, "mathnormal");
+       bool really_change_font = isTextFont(from_ascii(pi.base.fontname));
+       FontSetChanger dummy(pi.base, "mathnormal", really_change_font);
        cell(0).draw(pi, x, y);
        drawMarkers(pi, x, y);
 }
@@ -67,6 +70,12 @@ void InsetMathEnsureMath::write(WriteStream & os) const
 }
 
 
+void InsetMathEnsureMath::mathmlize(MathStream & os) const
+{
+       os << cell(0);
+}
+
+
 void InsetMathEnsureMath::infoize(odocstream & os) const
 {
        os << "EnsureMath";