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"
27 MathMacroArgument::MathMacroArgument(size_t n)
31 lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: "
35 // The profiler tells us not to use
36 // str_ = '#' + convert<docstring>(n);
37 // so we do the conversion of n to ASCII manually.
38 // This works because 1 <= n <= 9.
45 Inset * MathMacroArgument::clone() const
47 return new MathMacroArgument(*this);
51 void MathMacroArgument::setNumber(std::size_t n)
54 lyxerr << "MathMacroArgument::setNumber: wrong Argument id: "
63 void MathMacroArgument::write(WriteStream & os) const
69 void MathMacroArgument::metrics(MetricsInfo & mi, Dimension & dim) const
71 mathed_string_dim(mi.base.font, str_, dim);
75 void MathMacroArgument::draw(PainterInfo & pi, int x, int y) const
77 drawStrRed(pi, x, y, str_);
78 setPosCache(pi, x, y);
82 void MathMacroArgument::normalize(NormalStream & os) const
84 os << "[macroarg " << str_ << "] ";