From: André Pönitz Date: Wed, 13 Mar 2002 11:20:35 +0000 (+0000) Subject: only accept #n in macros with at least n arguments X-Git-Tag: 1.6.10~19662 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e9875b7610a5924c07641abfbaa6f317904a26db;p=features.git 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 --- 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('#')));