X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathMacroArgument.h;h=bb9fa1dc304f8742229caf04065f5460b89445f6;hb=cdc847fd304019a19425a0d5d9d42a556a937097;hp=4a52b1a1d20fda1e63a2bae1096a095cd63f694b;hpb=0facb603fefec1ecc927f77bcf6228ca1f035444;p=lyx.git diff --git a/src/mathed/MathMacroArgument.h b/src/mathed/MathMacroArgument.h index 4a52b1a1d2..bb9fa1dc30 100644 --- a/src/mathed/MathMacroArgument.h +++ b/src/mathed/MathMacroArgument.h @@ -21,33 +21,47 @@ namespace lyx { -/// A macro argument. -class MathMacroArgument : public InsetMath { +// A # that failed to parse +class InsetMathHash : public InsetMath { public: - /// - explicit MathMacroArgument(int number); + InsetMathHash(docstring const & str = docstring()) : str_('#' + str) {}; /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// void draw(PainterInfo &, int x, int y) const; /// - int number() const { return number_; } + void normalize(NormalStream &) const; + /// + void write(WriteStream & os) const; + +private: + Inset * clone() const; + +protected: + /// + docstring str_; +}; + + +/// A macro argument. +class MathMacroArgument : public InsetMathHash { +public: + /// Assumes 0 < number <= 9 + explicit MathMacroArgument(int number); /// + int number() const { return number_; } + /// Assumes 0 < n <= 9 void setNumber(int n); /// InsetCode lyxCode() const { return MATH_MACROARG_CODE; } /// void normalize(NormalStream &) const; - /// - void write(WriteStream & os) const; private: Inset * clone() const; /// A number between 1 and 9 int number_; - /// - docstring str_; };