mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
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:
parent
c2072fa890
commit
e9875b7610
@ -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('#')));
|
||||
|
Loading…
Reference in New Issue
Block a user