X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_binaryopinset.C;h=ce6dc2c5ace9dd46ae2e73d75351d4577557bdb5;hb=edbef46cd7865dab72ab6b503d62e2492479d297;hp=40fc662fbb0e1eee34a64f998969b5a722a896b6;hpb=f70513fe19b91d91e44d9dbf33572041457eebb7;p=lyx.git diff --git a/src/mathed/math_binaryopinset.C b/src/mathed/math_binaryopinset.C index 40fc662fbb..ce6dc2c5ac 100644 --- a/src/mathed/math_binaryopinset.C +++ b/src/mathed/math_binaryopinset.C @@ -1,24 +1,34 @@ -#include +/** + * \file math_binaryopinset.C + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Alejandro Aguilar Sierra + * \author André Pönitz + * + * Full author contact details are available in file CREDITS. + */ -#ifdef __GNUG__ -#pragma implementation -#endif +#include #include "math_binaryopinset.h" -#include "Painter.h" -#include "support/LOstream.h" +#include "PainterInfo.h" +#include "support/std_ostream.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); +auto_ptr MathBinaryOpInset::clone() const +{ + return auto_ptr(new MathBinaryOpInset(*this)); } @@ -28,22 +38,29 @@ int MathBinaryOpInset::opwidth() const } -void MathBinaryOpInset::metrics(MathMetricsInfo const & mi) const +#ifdef WITH_WARNINGS +#warning Andre, have a look here. (Lgb) +#endif +#if 0 +// That this is not declared in class MathBinaryOpInset makes +// Doxygen give warnings. (Lgb) +void MathBinaryOpInset::metrics(MetricsInfo & mi, Dimension & dim) 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()); + cell(0).metrics(mi); + cell(1).metrics(mi); + width_ = cell(0).width() + cell(1).width() + opwidth(); + ascent_ = max(cell(0).ascent(), cell(1).ascent()); + descent_ = max(cell(0).descent(), cell(1).descent()); } +#endif -void MathBinaryOpInset::draw(Painter & 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); +void MathBinaryOpInset::draw(PainterInfo & pain, int x, int y) const +{ + cell(0).draw(pain, x, y); + drawChar(pain, LM_TC_CONST, mi_, x + cell(0).width() , y, op_); + cell(1).draw(pain, x + width() - cell(1).width(), y); }