[email protected] wrote:
> Author: uwestoehr
> Date: Fri Sep 24 05:44:34 2010
> New Revision: 35485
> URL: http://www.lyx.org/trac/changeset/35485
>
> Log:
> GuiMathMatrix:
> - decorated matrices can have horizontal alignment
this code looks suspicious:
> @@ -122,10 +117,22 @@
> case 5: deco_name = "Vmatrix";
> break;
> }
> - string const str_ams = fromqstr(
> - QString("%1 %2 %3").arg(nx).arg(ny).arg(deco_name));
> - dispatch(FuncRequest(LFUN_MATH_AMS_MATRIX, str_ams));
> + // only if a special alignment is set create a 1x1 AMS array in
> which
> + // a normal array will be created, otherwise create just a
> normal AMS array
> + if (sh.contains('l') > 0 || sh.contains('r') > 0) {
> + string const str_ams = fromqstr(
> + QString("%1 %2
> %3").arg(int(1)).arg(int(1)).arg(deco_name));
> + dispatch(FuncRequest(LFUN_MATH_AMS_MATRIX, str_ams));
why close() and return are only in the else branch?
if we enter here, there will be 2 calls of
dispatch(FuncRequest(LFUN_MATH_MATRIX,something).
this is correct?
> + } else {
> + string const str_ams = fromqstr(
> + QString("%1 %2
> %3").arg(nx).arg(ny).arg(deco_name));
> + dispatch(FuncRequest(LFUN_MATH_AMS_MATRIX, str_ams));
> + close();
> + return;
> + }
> }
> + // create the normal array
> + dispatch(FuncRequest(LFUN_MATH_MATRIX, str));
pavel