From: Jean-Marc Lasgouttes Date: Tue, 16 Apr 2002 09:57:37 +0000 (+0000) Subject: fix math-delim X-Git-Tag: 1.6.10~19400 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2611cce4f1d656ab8d526bf5adc463d0dd511acc;p=features.git fix math-delim git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4006 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 53fac42189..d704a9c996 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2002-04-16 Jean-Marc Lasgouttes + + * formulabase.C (localDispatch): handle arguments of + LFUN_MATH_DELIM better. + 2002-04-04 Angus Leeming * formulabase.C: remove unused variables hack_x, hack_y, hack_button. diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 94fabe3786..de98c76ae9 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -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);