From: Jean-Marc Lasgouttes Date: Thu, 4 Oct 2018 14:05:46 +0000 (+0200) Subject: Fix display of gather in lefteqn mode X-Git-Tag: 2.3.3~50 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e8d96cb9b159c0e61c669b9a64e5deff00b4be9b;p=features.git Fix display of gather in lefteqn mode The column is flushed when the display of equations is flushed. Not sure what to do with RtL languages. Fixes bug 11324. (cherry picked from commit 7cb0284a3ffa469c4c99184725f5a3e0b4056508) --- diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index f0152854e5..f9625429c4 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -1843,15 +1843,19 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd, // static -char InsetMathGrid::colAlign(HullType type, col_type col) +char InsetMathGrid::colAlign(HullType type, col_type col, BufferParams const & bp) { switch (type) { case hullEqnArray: return "rcl"[col % 3]; case hullMultline: - case hullGather: return 'c'; + case hullGather: + if (!bp.is_math_indent) + return 'c'; + else + return 'l'; case hullAlign: case hullAlignAt: diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index 9cd22eae51..2e48453601 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -18,6 +18,8 @@ namespace lyx { +class BufferParams; + /** Gridded math inset base class. * This is the base to all grid-like editable math objects @@ -267,8 +269,9 @@ protected: // The following two functions are used in InsetMathHull and // InsetMathSplit. - /// The value of a fixed col align for a certain hull type - static char colAlign(HullType type, col_type col); + /// The value of a fixed col align for a certain hull type (can + /// depend on the "indent math" setting). + static char colAlign(HullType type, col_type col, BufferParams const &); /// The value of a fixed col spacing for a certain hull type static int colSpace(HullType type, col_type col); diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 0f7e9a85df..2c2cd413c1 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -446,7 +446,7 @@ bool InsetMathHull::idxLast(Cursor & cur) const // alignment is not implemented in the LyXHTML output. char InsetMathHull::defaultColAlign(col_type col) { - return colAlign(type_, col); + return colAlign(type_, col, buffer().params()); } @@ -468,7 +468,7 @@ char InsetMathHull::displayColAlign(idx_type idx) const case hullXAlignAt: case hullXXAlignAt: case hullFlAlign: - return colAlign(type_, col(idx)); + return colAlign(type_, col(idx), buffer().params()); default: break; } diff --git a/src/mathed/InsetMathSplit.cpp b/src/mathed/InsetMathSplit.cpp index c260e2e51e..200a0bc3c9 100644 --- a/src/mathed/InsetMathSplit.cpp +++ b/src/mathed/InsetMathSplit.cpp @@ -16,6 +16,7 @@ #include "MathStream.h" #include "MathSupport.h" +#include "Buffer.h" #include "FuncRequest.h" #include "FuncStatus.h" #include "support/gettext.h" @@ -61,7 +62,7 @@ char InsetMathSplit::defaultColAlign(col_type col) || name_ == "aligned" || name_ == "align" || name_ == "alignedat") - return colAlign(hullAlign, col); + return colAlign(hullAlign, col, buffer().params()); return 'l'; } @@ -78,7 +79,7 @@ char InsetMathSplit::displayColAlign(idx_type idx) const || name_ == "aligned" || name_ == "align" || name_ == "alignedat") - return colAlign(hullAlign, col(idx)); + return colAlign(hullAlign, col(idx), buffer().params()); return InsetMathGrid::displayColAlign(idx); } diff --git a/status.23x b/status.23x index 1bc9f278bf..83beca4cd4 100644 --- a/status.23x +++ b/status.23x @@ -128,6 +128,9 @@ What's new - Repair (de)activation of plural, capitalize, etc, for refstyle. +- Fix display of gather environment in leqno mode (bug 11324). + + * INTERNALS