]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_braceinset.C
remove unneeded member
[lyx.git] / src / mathed / math_braceinset.C
index 65970370c4771051979066236077e44977b730ec..614666d56efe84e74f253ef59ecded74bbd43e61 100644 (file)
@@ -8,6 +8,9 @@
 #include "math_parser.h"
 #include "math_support.h"
 #include "math_mathmlstream.h"
+#include "support/LOstream.h"
+
+using std::max;
 
 
 MathBraceInset::MathBraceInset()
@@ -15,28 +18,37 @@ MathBraceInset::MathBraceInset()
 {}
 
 
+MathBraceInset::MathBraceInset(MathArray const & ar)
+       : MathNestInset(1)
+{
+       cell(0) = ar;
+}
+
+
 MathInset * MathBraceInset::clone() const
-{   
+{
        return new MathBraceInset(*this);
 }
 
 
-void MathBraceInset::metrics(MathMetricsInfo const & mi) const
+void MathBraceInset::metrics(MathMetricsInfo & mi) const
 {
        xcell(0).metrics(mi);
        int a, d;
-       mathed_char_dim(LM_TC_TEX, mi, '{', a, d, wid_);
-       ascent_  = std::max(xcell(0).ascent(), a);
-       descent_ = std::max(xcell(0).descent(), a);
+       mathed_char_dim(mi.base.font, '{', a, d, wid_);
+       ascent_  = max(xcell(0).ascent(), a);
+       descent_ = max(xcell(0).descent(), a);
        width_   = xcell(0).width() + 2 * wid_;
 }
 
 
-void MathBraceInset::draw(Painter & pain, int x, int y) const
-{ 
-       drawChar(pain, LM_TC_TEX, mi_, x, y, '{');
-       xcell(0).draw(pain, x + wid_, y);
-       drawChar(pain, LM_TC_TEX, mi_, x + width_ - wid_, y, '}');
+void MathBraceInset::draw(MathPainterInfo & pi, int x, int y) const
+{
+       LyXFont font = pi.base.font;
+       font.setColor(LColor::latex);
+       drawChar(pi, font, x, y, '{');
+       xcell(0).draw(pi, x + wid_, y);
+       drawChar(pi, font, x + width_ - wid_, y, '}');
 }
 
 
@@ -52,3 +64,7 @@ void MathBraceInset::normalize(NormalStream & os) const
 }
 
 
+void MathBraceInset::infoize(std::ostream & os) const
+{
+       os << "Nested Block: ";
+}