]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathEnsureMath.cpp
Simplify Changers interface
[lyx.git] / src / mathed / InsetMathEnsureMath.cpp
index 382c6fedd8e937fb064e0d52a9eb383b86816a34..d73a1cb35991e49e8c553d95ccaba20f1f1ad27e 100644 (file)
@@ -39,7 +39,8 @@ Inset * InsetMathEnsureMath::clone() const
 void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        bool really_change_font = isTextFont(mi.base.fontname);
-       Changer dummy = mi.base.changeFontSet("mathnormal", really_change_font);
+       Changer dummy = really_change_font ? mi.base.changeFontSet("mathnormal")
+               : Changer();
        cell(0).metrics(mi, dim);
        metricsMarkers(mi, dim);
 }
@@ -48,7 +49,8 @@ void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const
 void InsetMathEnsureMath::draw(PainterInfo & pi, int x, int y) const
 {
        bool really_change_font = isTextFont(pi.base.fontname);
-       Changer dummy = pi.base.changeFontSet("mathnormal", really_change_font);
+       Changer dummy = really_change_font ? pi.base.changeFontSet("mathnormal")
+               : Changer();
        cell(0).draw(pi, x, y);
        drawMarkers(pi, x, y);
 }