X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_binaryopinset.C;h=aaac72a1867c19725d0153fe0f543e5af40dca4f;hb=4bc59f21015e9151841eea3733b97d25cd616fdc;hp=ff67faf7a95e670c4f2bb0a7427d55863ed34561;hpb=0daba49b1d7493cbf76658314b7459b51f870081;p=lyx.git diff --git a/src/mathed/math_binaryopinset.C b/src/mathed/math_binaryopinset.C index ff67faf7a9..aaac72a186 100644 --- a/src/mathed/math_binaryopinset.C +++ b/src/mathed/math_binaryopinset.C @@ -1,21 +1,26 @@ +#include + #ifdef __GNUG__ #pragma implementation #endif #include "math_binaryopinset.h" -#include "Painter.h" +#include "MathPainterInfo.h" #include "support/LOstream.h" -#include "support.h" +#include "math_support.h" #include "math_mathmlstream.h" +using std::max; + + MathBinaryOpInset::MathBinaryOpInset(char op) : MathNestInset(2), op_(op) {} MathInset * MathBinaryOpInset::clone() const -{ +{ return new MathBinaryOpInset(*this); } @@ -26,32 +31,32 @@ int MathBinaryOpInset::opwidth() const } -void MathBinaryOpInset::metrics(MathMetricsInfo const & mi) const +void MathBinaryOpInset::metrics(MathMetricsInfo & mi) const { mi_ = mi; xcell(0).metrics(mi); xcell(1).metrics(mi); width_ = xcell(0).width() + xcell(1).width() + opwidth(); - ascent_ = std::max(xcell(0).ascent(), xcell(1).ascent()); - descent_ = std::max(xcell(0).descent(), xcell(1).descent()); + ascent_ = max(xcell(0).ascent(), xcell(1).ascent()); + descent_ = max(xcell(0).descent(), xcell(1).descent()); } -void MathBinaryOpInset::draw(Painter & pain, int x, int y) const -{ - xcell(0).draw(pain, x, y); +void MathBinaryOpInset::draw(MathPainterInfo & pain, int x, int y) const +{ + xcell(0).draw(pain, x, y); drawChar(pain, LM_TC_CONST, mi_, x + xcell(0).width() , y, op_); - xcell(1).draw(pain, x + width() - xcell(1).width(), y); + xcell(1).draw(pain, x + width() - xcell(1).width(), y); } -void MathBinaryOpInset::write(MathWriteInfo & os) const +void MathBinaryOpInset::write(WriteStream & os) const { os << '{' << cell(0) << op_ << cell(1) << '}'; } -void MathBinaryOpInset::writeNormal(NormalStream & os) const +void MathBinaryOpInset::normalize(NormalStream & os) const { os << "[binop " << op_ << ' ' << cell(0) << ' ' << cell(1) << ']'; }