5 #include "math_macroarg.h"
6 #include "math_macro.h"
8 #include "math_mathmlstream.h"
9 #include "math_support.h"
14 MathMacroArgument::MathMacroArgument(int n)
15 : MathNestInset(1), number_(n), expanded_(false)
18 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
27 MathInset * MathMacroArgument::clone() const
29 return new MathMacroArgument(*this);
33 void MathMacroArgument::write(WriteStream & os) const
39 void MathMacroArgument::metrics(MathMetricsInfo const & mi) const
43 xcell(0).metrics(mi_);
44 width_ = xcell(0).width();
45 ascent_ = xcell(0).ascent();
46 descent_ = xcell(0).descent();
48 mathed_string_dim(LM_TC_TEX, mi_, str_, ascent_, descent_, width_);
52 void MathMacroArgument::draw(Painter & pain, int x, int y) const
55 xcell(0).draw(pain, x, y);
57 drawStr(pain, LM_TC_TEX, mi_, x, y, str_);
61 void MathMacroArgument::normalize(NormalStream & os) const
63 os << "[macroarg " << str_ << "] ";
67 void MathMacroArgument::substitute(MathMacro const & m)
69 cell(0) = m.cell(number_ - 1);