2 * \file MathMacroArgument.cpp
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 "MathStream.h"
16 #include "MathSupport.h"
26 MathMacroArgument::MathMacroArgument(size_t n)
30 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
33 // The profiler tells us not to use
34 // str_ = '#' + convert<docstring>(n);
35 // so we do the conversion of n to ASCII manually.
36 // This works because 1 <= n <= 9.
43 Inset * MathMacroArgument::clone() const
45 return new MathMacroArgument(*this);
49 void MathMacroArgument::write(WriteStream & os) const
55 void MathMacroArgument::metrics(MetricsInfo & mi, Dimension & dim) const
57 mathed_string_dim(mi.base.font, str_, dim);
61 void MathMacroArgument::draw(PainterInfo & pi, int x, int y) const
63 drawStrRed(pi, x, y, str_);
64 setPosCache(pi, x, y);
68 void MathMacroArgument::normalize(NormalStream & os) const
70 os << "[macroarg " << str_ << "] ";