]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBinom.C
Allows editing when the Prefs dialog is opened; fix bug 3140:
[lyx.git] / src / mathed / InsetMathBinom.C
index e09de0e319790cd8813711ede01ed9482d3a3889..564c21979db77d5749306b015508fc076b5ab556 100644 (file)
 #include "InsetMathBinom.h"
 #include "MathData.h"
 #include "MathSupport.h"
-#include "MathMLStream.h"
+#include "MathStream.h"
+
+
+namespace lyx {
 
 
 using std::max;
@@ -42,7 +45,7 @@ int InsetMathBinom::dw() const
 }
 
 
-void InsetMathBinom::metrics(MetricsInfo & mi, Dimension & dim) const
+bool InsetMathBinom::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        ScriptChanger dummy(mi.base);
        cell(0).metrics(mi);
@@ -51,7 +54,9 @@ void InsetMathBinom::metrics(MetricsInfo & mi, Dimension & dim) const
        dim.des = cell(1).height() + 4 - 5;
        dim.wid = max(cell(0).width(), cell(1).width()) + 2 * dw() + 4;
        metricsMarkers2(dim);
+       bool const changed = dim_ != dim;
        dim_ = dim;
+       return changed;
 }
 
 
@@ -61,9 +66,9 @@ void InsetMathBinom::draw(PainterInfo & pi, int x, int y) const
        ScriptChanger dummy(pi.base);
        cell(0).draw(pi, m - cell(0).width() / 2, y - cell(0).descent() - 3 - 5);
        cell(1).draw(pi, m - cell(1).width() / 2, y + cell(1).ascent()  + 3 - 5);
-       mathed_draw_deco(pi, x, y - dim_.ascent(), dw(), dim_.height(), "(");
+       mathed_draw_deco(pi, x, y - dim_.ascent(), dw(), dim_.height(), from_ascii("("));
        mathed_draw_deco(pi, x + dim_.width() - dw(), y - dim_.ascent(),
-               dw(), dim_.height(), ")");
+               dw(), dim_.height(), from_ascii(")"));
        drawMarkers2(pi, x, y);
 }
 
@@ -87,3 +92,6 @@ void InsetMathBinom::normalize(NormalStream & os) const
 {
        os << "[binom " << cell(0) << ' ' << cell(1) << ']';
 }
+
+
+} // namespace lyx