1 #include "math_macroarg.h"
2 #include "math_macro.h"
3 #include "math_mathmlstream.h"
4 #include "math_support.h"
11 MathMacroArgument::MathMacroArgument(int n)
12 : MathNestInset(1), number_(n), expanded_(false)
15 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
19 str_[1] = static_cast<unsigned char>('0' + n);
24 auto_ptr<InsetBase> MathMacroArgument::clone() const
26 return auto_ptr<InsetBase>(new MathMacroArgument(*this));
30 void MathMacroArgument::write(WriteStream & os) const
36 void MathMacroArgument::metrics(MetricsInfo & mi, Dimension & dim) const
39 cell(0).metrics(mi, dim_);
41 mathed_string_dim(mi.base.font, str_, dim_);
46 void MathMacroArgument::draw(PainterInfo & 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);