]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_binominset.C
Fix bug 2481
[lyx.git] / src / mathed / math_binominset.C
index 20675a8ca4ba67e3b4cabec8bb81f5da17aaa40f..c2718bb049726d0afe2ad7a98e0118cb8c30333e 100644 (file)
@@ -11,8 +11,8 @@
 #include <config.h>
 
 #include "math_binominset.h"
+#include "math_data.h"
 #include "math_support.h"
-#include "support/LOstream.h"
 #include "math_mathmlstream.h"
 
 
@@ -25,7 +25,7 @@ MathBinomInset::MathBinomInset(bool choose)
 {}
 
 
-auto_ptr<InsetBase> MathBinomInset::clone() const
+auto_ptr<InsetBase> MathBinomInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathBinomInset(*this));
 }
@@ -47,10 +47,11 @@ void MathBinomInset::metrics(MetricsInfo & mi, Dimension & dim) const
        ScriptChanger dummy(mi.base);
        cell(0).metrics(mi);
        cell(1).metrics(mi);
-       dim_.asc = cell(0).height() + 4 + 5;
-       dim_.des = cell(1).height() + 4 - 5;
-       dim_.wid = max(cell(0).width(), cell(1).width()) + 2 * dw() + 4;
-       dim = dim_;
+       dim.asc = cell(0).height() + 4 + 5;
+       dim.des = cell(1).height() + 4 - 5;
+       dim.wid = max(cell(0).width(), cell(1).width()) + 2 * dw() + 4;
+       metricsMarkers2(dim);
+       dim_ = dim;
 }
 
 
@@ -63,6 +64,13 @@ void MathBinomInset::draw(PainterInfo & pi, int x, int y) const
        mathed_draw_deco(pi, x, y - dim_.ascent(), dw(), dim_.height(), "(");
        mathed_draw_deco(pi, x + dim_.width() - dw(), y - dim_.ascent(),
                dw(), dim_.height(), ")");
+       drawMarkers2(pi, x, y);
+}
+
+
+bool MathBinomInset::extraBraces() const
+{
+       return choose_;
 }