2 #include "math_macroarg.h"
3 #include "math_macro.h"
4 #include "math_mathmlstream.h"
5 #include "math_support.h"
12 MathMacroArgument::MathMacroArgument(int n)
13 : MathNestInset(1), number_(n), expanded_(false)
16 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
20 str_[1] = static_cast<unsigned char>('0' + n);
25 MathInset * MathMacroArgument::clone() const
27 return new MathMacroArgument(*this);
31 void MathMacroArgument::write(WriteStream & os) const
37 void MathMacroArgument::metrics(MathMetricsInfo & mi) const
40 dim_ = cell(0).metrics(mi);
42 mathed_string_dim(mi.base.font, str_, dim_);
46 void MathMacroArgument::draw(MathPainterInfo & pi, int x, int y) const
49 cell(0).draw(pi, x, y);
51 drawStrRed(pi, x, y, str_);
55 void MathMacroArgument::normalize(NormalStream & os) const
57 os << "[macroarg " << str_ << "] ";
61 void MathMacroArgument::substitute(MathMacro const & m)
63 cell(0) = m.cell(number_ - 1);