From: André Pönitz Date: Tue, 7 Jan 2003 09:42:10 +0000 (+0000) Subject: Fix for 594 X-Git-Tag: 1.6.10~17726 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=19f0a9f14238c9651b0bb62731892af2d8914ee7;p=features.git Fix for 594 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5908 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index ac4f78058e..5ebce38133 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2003-01-07 João Luis Meloni Assirati + * math_hullinset.C: fix numbering problem of AMS gather and + multline environments (bugs 518 and 594). Treat gather the same + way as eqnarray and multline as a special case. + 2002-12-18 John Levon * math_factory.C: do not assume symbol font is present diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 8ca0155616..dfefb4faeb 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -358,7 +358,8 @@ void MathHullInset::header_write(WriteStream & os) const os << "\\[\n"; } - else if (type_ == "eqnarray" || type_ == "align" || type_ == "flalign") + else if (type_ == "eqnarray" || type_ == "align" || type_ == "flalign" + || type_ == "gather" || type_ == "multline") os << "\\begin{" << type_ << star(n) << "}\n"; else if (type_ == "alignat" || type_ == "xalignat") @@ -369,9 +370,6 @@ void MathHullInset::header_write(WriteStream & os) const os << "\\begin{" << type_ << '}' << '{' << static_cast((ncols() + 1)/2) << "}\n"; - else if (type_ == "multline" || type_ == "gather") - os << "\\begin{" << type_ << "}\n"; - else os << "\\begin{unknown" << star(n) << '}'; } @@ -394,10 +392,11 @@ void MathHullInset::footer_write(WriteStream & os) const os << "\\]\n"; else if (type_ == "eqnarray" || type_ == "align" || type_ == "flalign" - || type_ == "alignat" || type_ == "xalignat") - os << "\\end{" << type_ << star(n) << "}\n"; + || type_ == "alignat" || type_ == "xalignat" + || type_ == "gather" || type_ == "multline") + os << "\\end{" << type_ << star(n) << "}\n"; - else if (type_ == "xxalignat" || type_ == "multline" || type_ == "gather") + else if (type_ == "xxalignat") os << "\\end{" << type_ << "}\n"; else @@ -627,7 +626,7 @@ string MathHullInset::eolString(row_type row, bool fragile) const if (numberedType()) { if (!label_[row].empty() && !nonum_[row]) res += "\\label{" + label_[row] + '}'; - if (nonum_[row]) + if (nonum_[row] && (type_ != "multline")) res += "\\nonumber "; } return res + MathGridInset::eolString(row, fragile); @@ -766,8 +765,11 @@ MathInset::result_type MathHullInset::dispatch if (display()) { //bv->lockedInsetStoreUndo(Undo::INSERT); bool old = numberedType(); - for (row_type row = 0; row < nrows(); ++row) - numbered(row, !old); + if (type_ == "multline") + numbered(nrows() - 1, !old); + else + for (row_type row = 0; row < nrows(); ++row) + numbered(row, !old); //bv->owner()->message(old ? _("No number") : _("Number")); //updateLocal(bv, true); } @@ -775,16 +777,17 @@ MathInset::result_type MathHullInset::dispatch case LFUN_MATH_NONUMBER: if (display()) { + row_type r = (type_ == "multline") ? nrows() - 1 : row(idx); //bv->lockedInsetStoreUndo(Undo::INSERT); - bool old = numbered(row(idx)); + bool old = numbered(r); //bv->owner()->message(old ? _("No number") : _("Number")); - numbered(row(idx), !old); + numbered(r, !old); //updateLocal(bv, true); } return DISPATCHED; case LFUN_INSERT_LABEL: { - row_type r = row(idx); + row_type r = (type_ == "multline") ? nrows() - 1 : row(idx); string old_label = label(r); string new_label = cmd.argument;