Fix bug #7090 (Segfault in refreshing instant preview when math macro changes)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36832 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2010-12-11 18:15:34 +00:00
parent 7ba8c1d542
commit 14cbb6cb3d

View File

@ -721,11 +721,11 @@ void MathMacroTemplate::changeArity(Cursor & cur,
{
// remove parameter which do not appear anymore in the definition
for (int i = numargs_; i > newNumArg; --i)
removeParameter(cur, inset_pos, numargs_ - 1, false);
removeParameter(cur, inset_pos, numargs_ - 1, true);
// add missing parameter
for (int i = numargs_; i < newNumArg; ++i)
insertParameter(cur, inset_pos, numargs_, false, false);
insertParameter(cur, inset_pos, numargs_, true, false);
}