5 #include "math_macroarg.h"
6 #include "math_macro.h"
7 #include "math_mathmlstream.h"
8 #include "math_support.h"
15 MathMacroArgument::MathMacroArgument(int n)
16 : MathNestInset(1), number_(n), expanded_(false)
19 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
23 str_[1] = static_cast<unsigned char>('0' + n);
28 MathInset * MathMacroArgument::clone() const
30 return new MathMacroArgument(*this);
34 void MathMacroArgument::write(WriteStream & os) const
40 void MathMacroArgument::metrics(MathMetricsInfo & mi) const
43 dim_ = cell(0).metrics(mi);
45 mathed_string_dim(mi.base.font, str_, dim_);
49 void MathMacroArgument::draw(MathPainterInfo & pi, int x, int y) const
52 cell(0).draw(pi, x, y);
54 drawStrRed(pi, x, y, str_);
58 void MathMacroArgument::normalize(NormalStream & os) const
60 os << "[macroarg " << str_ << "] ";
64 void MathMacroArgument::substitute(MathMacro const & m)
66 cell(0) = m.cell(number_ - 1);