Fix bug #6939 (Using math-insert to input math macros overwrites math expressions)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@36526 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2010-11-26 22:12:56 +00:00
parent 5be2b2ed37
commit 3e722cd656
2 changed files with 12 additions and 0 deletions

View File

@ -1300,6 +1300,15 @@ void Cursor::niceInsert(MathAtom const & t)
MathData ar(&buffer());
asArray(safe, ar);
insert(ar);
} else if (t->asMacro() && !safe.empty()) {
MathData ar(&buffer());
asArray(safe, ar);
docstring const name = t->asMacro()->name();
MacroData const * data = buffer().getMacro(name);
if (data && data->numargs() - data->optionals() > 0) {
plainInsert(MathAtom(new InsetMathBrace(ar)));
posBackward();
}
}
}

View File

@ -56,6 +56,9 @@ What's new
* USER INTERFACE
- Fix insertion of a user math macro trough the math-insert lfun when a
selection is present (bug 6939).
- Make the modules description in Document > Settings fully translatable
(bug 6987).