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
This commit is contained in:
André Pönitz 2002-03-13 11:20:35 +00:00
parent c2072fa890
commit e9875b7610

View File

@ -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('#')));