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"
19 #include "support/lassert.h"
25 Inset * InsetMathHash::clone() const
27 return new InsetMathHash(*this);
31 void InsetMathHash::write(WriteStream & os) const
37 void InsetMathHash::metrics(MetricsInfo & mi, Dimension & dim) const
39 metricsStrRedBlack(mi, dim, str_);
43 void InsetMathHash::draw(PainterInfo & pi, int x, int y) const
45 drawStrRed(pi, x, y, str_);
49 void InsetMathHash::normalize(NormalStream & os) const
51 os << "[hash " << str_ << "] ";
55 MathMacroArgument::MathMacroArgument(int n)
59 LYXERR0("MathMacroArgument::MathMacroArgument: wrong Argument id: "
61 LASSERT(false, n = 1);
64 // The profiler tells us not to use
65 // str_ = '#' + convert<docstring>(n);
66 // so we do the conversion of n to ASCII manually.
67 // This works because 1 <= n <= 9.
73 Inset * MathMacroArgument::clone() const
75 return new MathMacroArgument(*this);
79 void MathMacroArgument::setNumber(int n)
82 LYXERR0("MathMacroArgument::setNumber: wrong Argument id: " << n);
83 LASSERT(false, return);
91 void MathMacroArgument::normalize(NormalStream & os) const
93 os << "[macroarg " << str_ << "] ";