5 #include "math_macroarg.h"
6 #include "math_macro.h"
8 #include "mathed/support.h"
13 MathMacroArgument::MathMacroArgument(int n)
14 : MathNestInset(1), number_(n), expanded_(false)
17 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
26 MathInset * MathMacroArgument::clone() const
28 return new MathMacroArgument(*this);
32 void MathMacroArgument::write(std::ostream & os, bool /*fragile*/) const
38 void MathMacroArgument::metrics(MathStyles st) const
42 width_ = xcell(0).width();
43 ascent_ = xcell(0).ascent();
44 descent_ = xcell(0).descent();
46 mathed_string_dim(LM_TC_TEX, size(), str_, width_, ascent_, descent_);
50 void MathMacroArgument::draw(Painter & pain, int x, int y) const
53 xcell(0).draw(pain, x, y);
55 drawStr(pain, LM_TC_TEX, size(), x, y, str_);
59 void MathMacroArgument::writeNormal(std::ostream & os) const
61 os << "[macroarg " << number_ << "] ";
65 void MathMacroArgument::substitute(MathMacro const & m)
67 cell(0) = m.cell(number_ - 1);