2 * \file MathMacroArgument.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
9 * Full author contact details are available in file CREDITS.
14 #include "MathMacroArgument.h"
15 #include "InsetMathMacro.h"
16 #include "MathStream.h"
17 #include "MathSupport.h"
18 #include "support/convert.h"
30 MathMacroArgument::MathMacroArgument(size_t n)
34 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
37 str_ = '#' + convert<docstring>(n);
41 auto_ptr<InsetBase> MathMacroArgument::doClone() const
43 return auto_ptr<InsetBase>(new MathMacroArgument(*this));
47 void MathMacroArgument::write(WriteStream & os) const
53 void MathMacroArgument::metrics(MetricsInfo & mi, Dimension & dim) const
55 mathed_string_dim(mi.base.font, str_, dim_);
60 void MathMacroArgument::draw(PainterInfo & pi, int x, int y) const
62 drawStrRed(pi, x, y, str_);
63 setPosCache(pi, x, y);
67 void MathMacroArgument::normalize(NormalStream & os) const
69 os << "[macroarg " << str_ << "] ";