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"
18 #include "support/debug.h"
23 MathMacroArgument::MathMacroArgument(int n
)
27 LYXERR0("MathMacroArgument::MathMacroArgument: wrong Argument id: " << n
);
30 // The profiler tells us not to use
31 // str_ = '#' + convert<docstring>(n);
32 // so we do the conversion of n to ASCII manually.
33 // This works because 1 <= n <= 9.
40 Inset
* MathMacroArgument::clone() const
42 return new MathMacroArgument(*this);
46 void MathMacroArgument::setNumber(int n
)
49 LYXERR0("MathMacroArgument::setNumber: wrong Argument id: " << n
);
57 void MathMacroArgument::write(WriteStream
& os
) const
63 void MathMacroArgument::metrics(MetricsInfo
& mi
, Dimension
& dim
) const
65 mathed_string_dim(mi
.base
.font
, str_
, dim
);
69 void MathMacroArgument::draw(PainterInfo
& pi
, int x
, int y
) const
71 drawStrRed(pi
, x
, y
, str_
);
72 setPosCache(pi
, x
, y
);
76 void MathMacroArgument::normalize(NormalStream
& os
) const
78 os
<< "[macroarg " << str_
<< "] ";