#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)
{}
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);
}
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);
}
}
+void InsetMathEnsureMath::mathmlize(MathStream & os) const
+{
+ os << cell(0);
+}
+
+
void InsetMathEnsureMath::infoize(odocstream & os) const
{
os << "EnsureMath";