X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_braceinset.C;h=614666d56efe84e74f253ef59ecded74bbd43e61;hb=d359dd8fca52c4f0100f7cf4bf636113c5c4e49f;hp=9e73f782935e7da5a594db9279d8b1a107da7267;hpb=2b8ef58dc021912b2862328b9000cfe37578ea37;p=lyx.git diff --git a/src/mathed/math_braceinset.C b/src/mathed/math_braceinset.C index 9e73f78293..614666d56e 100644 --- a/src/mathed/math_braceinset.C +++ b/src/mathed/math_braceinset.C @@ -8,7 +8,7 @@ #include "math_parser.h" #include "math_support.h" #include "math_mathmlstream.h" - +#include "support/LOstream.h" using std::max; @@ -18,29 +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; - whichFont(font_, LM_TC_TEX, mi); - mathed_char_dim(font_, '{', a, d, wid_); + 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 +void MathBraceInset::draw(MathPainterInfo & pi, int x, int y) const { - drawChar(pain, font_, x, y, '{'); - xcell(0).draw(pain, x + wid_, y); - drawChar(pain, font_, x + width_ - wid_, y, '}'); + 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, '}'); } @@ -54,3 +62,9 @@ void MathBraceInset::normalize(NormalStream & os) const { os << "[block " << cell(0) << ']'; } + + +void MathBraceInset::infoize(std::ostream & os) const +{ + os << "Nested Block: "; +}