Oops.... here it comes... -- André Pönitz ........................................ [EMAIL PROTECTED]
? mathedbug2.diff Index: ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -u -p -r1.13 -r1.14 --- ChangeLog 2001/02/12 11:25:44 1.13 +++ ChangeLog 2001/02/12 11:56:08 1.14 @@ -1,3 +1,9 @@ +2001-02-12 Dekel Tsur <[EMAIL PROTECTED]> + + * formula.C (LocalDispatch): Change the default action of + break-line to create an align* environment instead of eqnarray*. + + * math_inset.C (Metrics): Correct drawing of the multline environment. 2001-02-12 André Pönitz <[EMAIL PROTECTED]> * array.[hC]: replace private variable maxsize_ with call Index: formula.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formula.C,v retrieving revision 1.77 retrieving revision 1.78 diff -u -p -r1.77 -r1.78 --- formula.C 2001/02/08 15:09:14 1.77 +++ formula.C 2001/02/12 11:56:08 1.78 @@ -76,6 +76,7 @@ MathedCursor * InsetFormula::mathcursor int MathedInset::df_asc; int MathedInset::df_des; int MathedInset::df_width; +int MathedInset::workWidth; static @@ -407,8 +408,9 @@ int InsetFormula::descent(BufferView *, } -int InsetFormula::width(BufferView *, LyXFont const & f) const +int InsetFormula::width(BufferView * bv, LyXFont const & f) const { + MathedInset::workWidth = bv->workWidth(); lfont_size = f.size(); par->Metrics(); return par->Width(); //+2; @@ -418,6 +420,7 @@ int InsetFormula::width(BufferView *, Ly void InsetFormula::draw(BufferView * bv, LyXFont const & f, int baseline, float & x, bool) const { + MathedInset::workWidth = bv->workWidth(); Painter & pain = bv->painter(); // Seems commenting out solves a problem. LyXFont font = mathed_get_font(LM_TC_TEXTRM, LM_ST_TEXT); @@ -790,7 +793,7 @@ InsetFormula::LocalDispatch(BufferView * case LFUN_BREAKLINE: { bv->lockedInsetStoreUndo(Undo::INSERT); - byte c = arg.empty() ? 'e' : arg[0]; + byte c = arg.empty() ? '1' : arg[0]; mathcursor->Insert(c, LM_TC_CR); if (!label.empty()) { mathcursor->setLabel(label); Index: math_cursor.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.C,v retrieving revision 1.26 retrieving revision 1.27 diff -u -p -r1.26 -r1.27 --- math_cursor.C 2001/02/12 08:55:14 1.26 +++ math_cursor.C 2001/02/12 11:56:08 1.27 @@ -352,7 +352,7 @@ MathMatrixInset * create_multiline(short case LM_OT_MULTLINE: case LM_OT_MULTLINEN: columns = 1; - align = "c"; // This is incorrect! + align = "C"; break; case LM_OT_MPAR: case LM_OT_MPARN: Index: math_defs.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_defs.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -p -r1.38 -r1.39 --- math_defs.h 2001/02/12 08:55:14 1.38 +++ math_defs.h 2001/02/12 11:56:08 1.39 @@ -263,6 +263,8 @@ class MathedInset { virtual void SetStyle(short st) { size = st; } // Metrics(); /// virtual void SetName(string const & n) { name = n; } + /// + static int workWidth; protected: /// string name; Index: math_inset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_inset.C,v retrieving revision 1.19 retrieving revision 1.20 diff -u -p -r1.19 -r1.20 --- math_inset.C 2001/02/12 08:55:14 1.19 +++ math_inset.C 2001/02/12 11:56:08 1.20 @@ -468,6 +468,10 @@ void MathMatrixInset::Metrics() for (i = 1; i < nc; ++i) if (h_align[i] == 'R') ws[i] += 10*df_width; + // Increase ws[i] for 'C' column + if (h_align[0] == 'C') + if (ws[0] < 7*workWidth/8) + ws[0] = 7*workWidth/8; // Adjust local tabs cxrow = row; @@ -490,6 +494,14 @@ void MathMatrixInset::Metrics() case 'r': case 'R': lf = ws[i] - cxrow->getTab(i); + break; + case 'C': + if (cxrow == row) + lf = 0; + else if (!cxrow->getNext()) + lf = ws[i] - cxrow->getTab(i); + else + lf = (ws[i] - cxrow->getTab(i))/2; break; } ww = (isvoid) ? lf : lf + cxrow->getTab(i);