From e9875b7610a5924c07641abfbaa6f317904a26db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 13 Mar 2002 11:20:35 +0000 Subject: [PATCH] only accept #n in macros with at least n arguments git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3738 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_cursor.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index c3ee8d0996..98e772ccb4 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -38,6 +38,7 @@ #include "math_hullinset.h" #include "math_iterator.h" #include "math_macroarg.h" +#include "math_macrotemplate.h" #include "math_mathmlstream.h" #include "math_parser.h" #include "math_replace.h" @@ -1371,7 +1372,9 @@ bool MathCursor::interpret(char c) if (inMacroArgMode()) { --pos(); plainErase(); - if ('1' <= c && c <= '9') + int n = c - '0'; + MathMacroTemplate * p = formula()->par()->asMacroTemplate(); + if (p && 1 <= n && n <= p->numargs()) insert(MathAtom(new MathMacroArgument(c - '0'))); else { insert(MathAtom(new MathSpecialCharInset('#'))); -- 2.39.2