fix math-delim

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4006 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-04-16 09:57:37 +00:00
parent 07ba220763
commit 2611cce4f1
2 changed files with 13 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2002-04-16 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* formulabase.C (localDispatch): handle arguments of
LFUN_MATH_DELIM better.
2002-04-04 Angus Leeming <a.leeming@ic.ac.uk>
* formulabase.C: remove unused variables hack_x, hack_y, hack_button.

View File

@ -622,15 +622,14 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
case LFUN_MATH_DELIM:
{
//lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'\n";
string ls = "(";
string rs = ")";
istringstream is(arg.c_str());
is >> ls >> rs;
if (!is) {
lyxerr << "can't parse delimiters from '" << arg << "'\n";
lyxerr << "left: '" << ls << "' rs: '" << rs << "'\n";
break;
}
string ls;
string rs = split(arg, ls, ' ');
// Reasonable default values
if (ls.empty())
ls = '(';
if (rs.empty())
rs = ')';
bv->lockedInsetStoreUndo(Undo::EDIT);
mathcursor->handleDelim(ls, rs);
updateLocal(bv, true);